cancel
Showing results for 
Search instead for 
Did you mean: 

Can you use a unified firmware for dual core STM32H7x5?

TDK
Guru

I'd like to develop an application on the dual-core STM32H7 line.  To simplify development, I'd like to use the same firmware for both cores.  Is this possible?

As I understand it, accessing the SCB->CPUID can tell me which core is running. Okay, so that's what I can use to have the program do different things based on which core is running it.

To start both cores at the same time, it looks like you set option bytes BCM7=BCM4=1.

To start both in flash bank one, it looks like you set BCM7_ADD0=BCM4_ADD0=0x08000000.

So the firmware startup would be something like the following:

  1. Set stack pointer based on core type:
    1. If CM7, set stack pointer at ***
    2. If CM4, set stack pointer at YYY
  2. If CM7, perform memory initialization
    1. Copy data segment to SRAM
    2. Zero initialize memory as needed
    3. Call static constructors
    4. Set flag in SRAM to let CM4 know memory is initialized (or use hardware semaphore)
  3. If CM4, wait for CM7 to complete memory initialization
  4. Jump to main, do different things based on which core is running.

It appears that the ISR vector for CM4 and CM7 are identical in length, based on the startupt file that STM32CubeMX generated, so using the same one for both should work. Seemds odd, but I guess they both access the same peripherals so maybe that makes sense.

The auto-generated linker files for the CM4 core and the CM7 core are almost identical except (a) different flash memory locations, (b) different RAM locations. Only the CM7 has access to the TCM, so I'll have to use the SRAM instead.

Are there any other roadblocks to this scheme I'm not thinking about?

If you feel a post has answered your question, please click "Accept as Solution".
0 REPLIES 0