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


Executing from FLASH_ITCM in STM32F767ZI

Hello,

I am using system workbench and STM32F767ZI. I want do performance optimizations tests for my application. As suggested I went through the online documentation on Using CCM memory. But, I need some further informations.

I read the document AN4667 and about the cases that are considered to test the performance. Among one of those tests

1. I want to execute code from FLASH-ITCM instead of default FLASH-AXI
2. I want to load my data into SRAM1

I believe I have to customize the linker script file for that. But, I do not know how to do that for this test case.

I tried the following

FLASH_ITCM (rx) : ORIGIN = 0x00200000, LENGTH = 2048K
ITCM_RAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rw)  : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (xrw)  : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (xrw)  : ORIGIN = 0x20070000, LENGTH = 16K

and then I have placed the .data and .bss section in SRAM1

.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */

. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >SRAM1 AT> FLASH

I believe in this way all my data is going to be placed in SRAM1.

But, I am unaware to how do I execute the code from FLASH-ITCM or ITCM-RAM.

Could you please share your knowledge on this.

Thanking you in advance.

Regards,

Amit Dey

} >SRAM1 AT> FLASH


Fields of this means:

SRAM1 means that this section (in this case data). will be located in SRAM1 memory region.
FLASH means that this section will be loaded into FLASH memory region.

Startup will (must) copy this section from flash to SRAM1.

To place CODE into ITCM flash is enought to add new memory region and locate .text into this region. load region depend on if your programing tool can program itcm region.

Hello tadzik85,

as ITCM interface does not have write access so loading via itcm interface is not possible.

But, according to your solution when i do as follows my application does not run.

FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
FLASH_ITCM (rx) : ORIGIN = 0x00200000, LENGTH = 2048K

.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)

KEEP (*(.init))
KEEP (*(.fini))

. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */

} >FLASH_ITCM AT> FLASH


Do i have to locate .isr_vector as well in the FLASH_ITCM?


Hello tadzik85,

as ITCM interface does not have write access so loading via itcm interface is not possible.

But, according to your solution when i do as follows my application does not run.

FLASH (rx)  : ORIGIN = 0x08000000, LENGTH = 2048K
FLASH_ITCM (rx) : ORIGIN = 0x00200000, LENGTH = 2048K

.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)

KEEP (*(.init))
KEEP (*(.fini))

. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */

} >FLASH_ITCM AT> FLASH


Do i have to locate .isr_vector as well in the FLASH_ITCM?


Keil, STLink Utility suuport loading in ITCM region (probably thay converts adresses).


Yes ISR vectors also you need to place in ITCM but then you need to switch boot section in option bytes.

} >FLASH_ITCM AT> FLASH
This way is the most corect.


Check also ro_data sections.

Can you please eleborate what you meant by ‘switch boot section in option bytes’.

Also, do u mean that i need to do the following even for the ro_section.

} >FLASH_ITCM AT> FLASH



 

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