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


SW4STM32 overwriting areas of flash outside ROM?

I am trying to debug an application with a bootloader on a F105RC.
Bootloader runs from 0x08000000 then jumps to main application at 0x08004000.
Both bootloader and main app are seperate projects and so flashed into the MCU seperately.
At the moment the bootloader is very simple - it just jumps to the reset handler in the main application by checking the vector table at 0x08004000. The main application changes the exception table offset and then runs as normal.

My problem is that, when I debug or run the main application from within SW4STM32 it over-writes the bootloader and so will not run. If I inspect the flash memory using stlink I find at 0x08000000 starts with 464C457F, (which spells ELF....) rather than 20010000, 080003ED etc which is the correct start to the bootloader vector table.

Is there anything I can do to stop the run/debug over-writing the start of the flash space like this?

fwiw, to relocate the main application to 08004000 all I did was modify the .ld script with
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
ROM (rx) : ORIGIN = 0x08004000, LENGTH = 240K /*this changed from default*/
}

I think you should use a custom OpenOCD script which doesn’t erase the flash before uploading the firmware.
Thanks, I am confused that it is writing other data to the region, not just erasing it but any info on how to create a custom script that would do this?
@bugmenot: It is impossible to program the flash memory without previous erasing it

Thank you Dieter!

That fixed it, I can now debug my application biggrin


 

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