Compile and perform unit test for STM32 on Host

Discussions concerning TrueSTUDIO for STM32 9.0.0 and later versions.

Moderators: Markus Girdland, Mattias Norlander

dpa
Posts: 1
Joined: Tue May 07, 2019 9:53 am

Compile and perform unit test for STM32 on Host

Postby dpa » Tue May 07, 2019 11:18 am

Hi,

According to http://blog.atollic.com/build-your-embedded-code-as-a-windows-.exe-app, it is possible to compile code meant for STM32 target for x86 host. My main goal is to unit test my code on Host (PC x86) before deploying on target (STM32)
But by compiling my code with toolchain PC Tools, I got these errors:

12:00:00 **** Rebuild of configuration Debug for project Unittest_STM32F407 ****
Info: Internal Builder is used for build
gcc -DSTM32F4XX -DSTM32F40XX -DUSE_STDPERIPH_DRIVER -I../src -I../Libraries/CMSIS/Include -I../Libraries/Device/STM32F4xx/Include -I../Libraries/STM32F4xx_StdPeriph_Driver/inc -O2 -g -Wall -c -fmessage-length=0 -o Libraries\STM32F4xx_StdPeriph_Driver\src\misc.o ..\Libraries\STM32F4xx_StdPeriph_Driver\src\misc.c
gcc -DSTM32F4XX -DSTM32F40XX -DUSE_STDPERIPH_DRIVER -I../src -I../Libraries/CMSIS/Include -I../Libraries/Device/STM32F4xx/Include -I../Libraries/STM32F4xx_StdPeriph_Driver/inc -O2 -g -Wall -c -fmessage-length=0 -o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.o ..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.c
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s: Assembler messages:
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s:75: Error: no such instruction: `rev %eax,%eax'
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s:90: Error: no such instruction: `rev %eax,%eax'
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s:287: Error: no such instruction: `rev %ebx,%ebx'
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s:302: Error: no such instruction: `rev %eax,%eax'
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s:322: Error: no such instruction: `rev %eax,%eax'
C:\Users\user\AppData\Local\Temp\ccPqaR0v.s:337: Error: no such instruction: `rev %eax,%eax'

12:00:01 Build Finished (took 609ms)

>>Does anyone have an idea how to make it working?
You do not have the required permissions to view the files attached to this post.

rdamon
Posts: 10
Joined: Fri Mar 29, 2019 3:28 pm

Re: Compile and perform unit test for STM32 on Host

Postby rdamon » Tue May 07, 2019 2:45 pm

To unit test on a different platform, you need to stub out all platform specific code, especially anything that uses assembly since you are using very different CPUs.


Return to “TrueSTUDIO for STM32 discussions”

Who is online

Users browsing this forum: No registered users and 2 guests