Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


How to add header on beginning of FW for bootloader use

I’m using STM32L053 and there is a bootloader will check the application FW’s header.
The application firmware should have a header of 3 words (12 bytes):
attribute((section(“.fwhdr”)))
const volatile boot_fwhdr fwhdr = {
// CRC and size will be patched by external tool
.crc = 0,
.size = BOOT_MAGIC_SIZE,
.entrypoint = (uint32_t) _start,
};
The bootloader will check the CRC and length(after run python tool to create).
The third word is the pointer to your entry point function.
The bootloader will jump to that address upon startup.

And the question is how to add the header on beginning of FW for bootloader use ?
How to add the pointer of entry point function as the header on my FW?
The bootloader is create by gcc and some .ld file, but I don’t know how to add the header on my current project by using Keil or SW4STM32.

Nick

France

Hi Nick,

I can’t answer for Keil, but SW4STM32 uses gcc link editor, so you should just add a section before the .isr_vectors (or replacing it as you probably don’t need it as is):
.text: {
    KEEP(*(.fwdhr))
    KEEP(*(.isr_vector))
    ...

Then your firmware header will be inserted in front of your program.

Bernard (Ac6)

Hi Bernard
Thanks for your reply, I will try to add header by using SW4STM32.
My project are using Keil, so I need porting to SW4STM32 first, the free IDE tool is more best.
Is there anything we should be attention that porting from Keil to SW4STM32? or I should using STM32cubeMX to generate SW4STM32 project than porting current project to it?

Nick

France

Hi Nick,

The main advantage of STM32CubeMX being to generate the initialization code for your board, something you don’t need as you already have working code, I think the best would be to create a new project using SW4STM32 and copy your code in the src directory (either directly or in subdirectories, as you already structured it), with include files in inc.

Regarding the ST-provided firmware, you have two options:

  1. keep it in your source code
    • create a project without firmware
    • import all the code you compiled with Keil, keeping the directory structure
  2. have it imported by SW4STM32
    • only copy your code, not the firmware from ST
    • you may even import the firmware in a separate static library so thatyou can upgrade it simply if needed.
    • note that some third-party middlewares, like FreeRTOS, will be always included within th ecreated project, as they depend on application-specific configuration files


Hope this helps,

Bernard (Ac6)

Hi Bernard
There is a problem that when I add the header on linker scripts file (stm32l073xx_flash.ld)
The original file is

/* Entry Point */
ENTRY(Reset_Handler)

/* Define output sections */
SECTIONS
{
.text :
{
KEEP(*(.isr_vector))
*(.text*)

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

.....

The original entry point is Reset_Handler~~ and the Reset_Handler in (startup_stm32l073xx.s) will do

/* Call the clock system intitialization function.*/
bl SystemInit
/* Call static constructors */
bl __libc_init_array
/* Call the application’s entry point.*/
bl main

What should I do to add the KEEP(*(.fwdhr)) on stm32l073xx_flash.ld?
The fwdhr’s third word is entrypoint , but the original entrypoint is Reset_Handler, I am confused.

Nick



Hi Bernard

Thank you for your advice . it is so helpful to me.

Nick