Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Bug in disassembly: showing odd addresses

Hi,

I’m using the current System Workbench for STM32 with
OpenSTM32 IDE 2.4.0.201801120948 fr.ac6.feature.mcu.ide.feature.group Ac6
ARM Compiler for MCU 1.15.0.201708311556 fr.ac6.feature.mcu.externaltools.armnone.feature.group Ac6

I did some tests with code generation and found the following bug in code disassembly:

source code:

int store_array_ui8( uint8_t A[], int i ) {
Ai = 0;
return 0;
}

int store_array_ui16( uint16_t B[], int i ) {
Bi = 0;
return 0;
}

int store_array_ui32( uint32_t C[], int i ) {
Ci = 0;
return 0;
}

Disassembled code while debugging on a STM32F042K6 Nucleo32:

store_array_ui8:
080002de: movs r3, #0
080002e0: strb r3, r0, r1
080002e2: movs r0, r3
080002e4: bx lr
store_array_ui16:
080002e6: movs r3, #0
080002e8: lsls r1, r1, #1
080002ea: strh r3, r1, r0
080002ec: movs r0, r3
080002ee: bx lr
store_array_ui32:
080002f0: movs r3, #0
store_array_ui32:
080002f1: movs r3, #0
080002f3: lsls r1, r1, #2
080002f5: str r3, r1, r0
080002f7: movs r0, r3
080002f9: bx lr
080002fb: movs r0, r0

The bug starts at address 080002f0 and 080002f1when the same mnemonic “movs r3, #0” is decoded twice and odd (unaligned) addresses are shown.

I get the correct result when using objdump:

C:\Users\live>C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.15.0.201708311556\tools\compiler\bin\arm-none-eabi-objdump.exe -d “workspace\Codegen\Debug\Codegen.elf” | more

080002e6 :
80002e6: 2300 movs r3, #0
80002e8: 0049 lsls r1, r1, #1
80002ea: 520b strh r3, r1, r0
80002ec: 0018 movs r0, r3
80002ee: 4770 bx lr

080002f0 :
80002f0: 2300 movs r3, #0
80002f2: 0089 lsls r1, r1, #2
80002f4: 500b str r3, r1, r0
80002f6: 0018 movs r0, r3
80002f8: 4770 bx lr

 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs