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


Bootloader re-entry point from app on STM32F072

France

Hi everyone,

I’m using a custom board with STM32F072CB on board.
I’m using a custom bootloader and a simple app that make blink a led.

I modified the linker script of app to start at the right address.
-----------------------------------
linker script of app:
---------
/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20004000; /* end of RAM */

_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x200000C0, LENGTH = 16K - 0xC0
ROM (rx) : ORIGIN = 0x08002000, LENGTH = 128K - 0x2000
}
...
-----------------------------------
in my bootloader, i would like create an re-entry point (hot start) from app, so i try to modified the linker script to avec a start section like this:

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20002000; /* end of 8K RAM on AHB bus*/

/* Generate a link error if heap and stack don’t fit into RAM */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
FLASH (rx)  : ORIGIN = 0x08000000, LENGTH = 16K - 16
RESTART (rx)  : ORIGIN = 0x08001FFC, LENGTH = 4
RAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 8K
MEMORY_B1 (rx)  : ORIGIN = 0x60000000, LENGTH = 0K

}

/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH

.restart_vector :
{
. = ALIGN(4);
KEEP(*(.restart_vector)) /* ReStartup code */
. = ALIGN(4);
} >RESTART
-----------------------------------
in my code i added this section:
// The vector table.
// This relies on the linker script to place at correct location in memory.
typedef void (* const pRestart)(void);

attribute ((section(“.restart_vector”),used))
pRestart Restart_Vectors[] = { (pRestart) Restart };

anyone could help me ?
thanks

 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs