Linux serial_posix vs. Windows serial_w32

Post here first, or if you can't find a relevant section!
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

Could you share on github your variant ?
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post by simpleboy »

fpiSTM wrote: Mon May 30, 2022 7:02 am Could you share on github your variant ?
https://github.com/fsagbuya/variant-acsip.git
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

simpleboy wrote: Mon May 30, 2022 7:40 am
fpiSTM wrote: Mon May 30, 2022 7:02 am Could you share on github your variant ?
https://github.com/fsagbuya/variant-acsip.git
And the change made in the boards.txt? As your issue seems linked to wrong entry.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

You should not create new directory, your variant should be added in this folder:
https://github.com/stm32duino/Arduino_C ... 083R(B-Z)T

The L0 hal conf is also not correct as you duplicate it.

The PR example provided by @ag123 should help you to get it working.
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post by simpleboy »

fpiSTM wrote: Mon May 30, 2022 7:42 am
simpleboy wrote: Mon May 30, 2022 7:40 am
fpiSTM wrote: Mon May 30, 2022 7:02 am Could you share on github your variant ?
https://github.com/fsagbuya/variant-acsip.git
And the change made in the boards.txt? As your issue seems linked to wrong entry.
I already git push the boards.txt. Kindly refresh the repo.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

the variant_*h entry is defined by this line:
ACSIP.menu.pnum.ACSIP_S76S.build.variant=ACSIP_S76S

So build process will look for: variant_ACSIP_S76S.h
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post by simpleboy »

fpiSTM wrote: Mon May 30, 2022 7:45 am You should not create new directory, your variant should be added in this folder:
https://github.com/stm32duino/Arduino_C ... 083R(B-Z)T

The L0 hal conf is also not correct as you duplicate it.

The PR example provided by @ag123 should help you to get it working.
How can I correct it?

This variant I make is also the one I use in the deprecated stm32 core version 1.5.0.

I want to update it now to the official stm32 core, but I think I need to edit a lot of things, maybe I have more dependencies on that earlier version. I appreciate your help with this.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Linux serial_posix vs. Windows serial_w32

Post by ag123 »

i looked at some codes
https://github.com/fsagbuya/variant-acs ... ariant.cpp
it seemed you are using HSI? i.e. internal on chip oscillator

can you try using one of the generic variants?
choose one of those boards e.g. Generic L072RBTx or Generic L072RZTx

I'm guessing they may work in your case.
simpleboy
Posts: 19
Joined: Wed Apr 27, 2022 9:01 am
Answers: 1

Re: Linux serial_posix vs. Windows serial_w32

Post by simpleboy »

The variant_generic.h error has been resolved. I use the guide sent by @ag123 . However I got some new errors coming from RTC and LowPower.

In the old version, my firmware use stm32duino Low Power & RTC ver. 1.0.3, now I upgraded to the latest version 1.2.0.

What do you think is the problem here?

Here is the error message:

Code: Select all

/home/flo/Downloads/base-code/base-code/src/PWXRTC/src/PWXRTC.cpp: In member function 'uint32_t PWXRTC::getTimeDifference(uint32_t)':
/home/flo/Downloads/base-code/base-code/src/PWXRTC/src/PWXRTC.cpp:77:45: error: call of overloaded 'abs(uint32_t)' is ambiguous
   77 |   return (abs((getEpochTime() - inReference)));
      |                                             ^
In file included from /home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/cstdlib:75,
                 from /home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/stdlib.h:36,
                 from /home/flo/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/wiring.h:24,
                 from /home/flo/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/Arduino.h:36,
                 from /home/flo/Downloads/base-code/base-code/src/PWXRTC/src/PWXRTC.h:14,
                 from /home/flo/Downloads/base-code/base-code/src/PWXRTC/src/PWXRTC.cpp:12:
/home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/stdlib.h:70:5: note: candidate: 'int abs(int)'
   70 | int abs (int);
      |     ^~~
In file included from /home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/cstdlib:77,
                 from /home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/stdlib.h:36,
                 from /home/flo/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/wiring.h:24,
                 from /home/flo/.arduino15/packages/STMicroelectronics/hardware/stm32/2.2.0/cores/arduino/Arduino.h:36,
                 from /home/flo/Downloads/base-code/base-code/src/PWXRTC/src/PWXRTC.h:14,
                 from /home/flo/Downloads/base-code/base-code/src/PWXRTC/src/PWXRTC.cpp:12:
/home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/home/flo/.arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/arm-none-eabi/include/c++/10.3.1/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Linux serial_posix vs. Windows serial_w32

Post by fpiSTM »

abs() is the one provided by the std lib c++, error is values does not have the same type so it could not find the correct abs() method to use:
return (abs((getEpochTime() - inReference)))

You can try to cast them as uint.
Post Reply

Return to “General discussion”