Thanks for the tips. I created a second project for the second core and followed your advice, but I still face a problem - I can't flash the new program to the second core, I get this warning:
'PE-ERROR: Warning. Can't read memory while part is running. @11d52b0 (4 bytes)'
any advice on how to fix that? I need to be able to run a piece of code on the second core.
What I did so far:
1. I found few example projects online and checked their linker_flash.ld file in Project_Settings\Linker_Files\
2. I checked that the flash and RAM settings for each core in these examples. In one of them Core Z4_0 had flash size of 1856K starting at 0x01000000 . According to the reference manual NVM memory map, the next available free memory block starts at 0x01200000 - this is exactly where core Z4_1 has its beginning. It is set as FLASH_BASE_ADDR or ' m_text : org = ' variable.
2. Similar logic applies to RAM. To the base address of 0x40000000 for the Z4_0 core, the next cores in the example had the base set to the address of 0x40040000 (core Z4_1) and 0x40080000 (core Z2_0), as each core has 256K of RAM for its disposal.
3. I tried to apply this to my code. My application uses two cores, Z4_0 has flash of 1152K, Z4_1 flash of 1856K, and 256K RAM for each core. Therefore I set the FLASH_BASE_ADDR to 0x01140000 ( 0x1000000 [Z4_0 base] + 0x119400 [1152K Z4_0 flash size] = 0x111 9400, so the closest free flash block starts at 0x01140000), and SRAM_BASE_ADDR to 0x40040000 (similar logic as above). My current settings for the memory are listed below:
| | Z4_0 | Z4_1 |
| SRAM_BASE_ADDR | 0x4000000 | 0x40040000 |
| FLASH_BASE_ADDR | 0x01000000 | 0x01140000 |
However, the other settings for both of the cores I left the same as they were. I don't really know what they stand for. These settings are:
flash_rchw : org = 0x00FA0000, len = 0x4
cpu0_reset_vec : org = 0x00FA0000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00FA0000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00FA0000+0x04, len = 0x4
rappid_boot_data : org = 0x00FA0000+0x08, len = 0x8
4. After setting this up, I tried to flash the board and it failed. I tried with different debugger confiurations.
The 'USB_Multilink' Interface for the debugger settings, flashing gets stuck at 90% and freezes.
The 'OpenSDA Embedded Debug' Interface for the debugger gives a warning and fails. The warning is:
PE-ERROR: Warning. Can't read registers while part is running
PE-ERROR: Warning. Can't read memory while part is running. @11d52b0 (4 bytes)
I noted that the debugger has a problem writing to memory that is close to what I set up - I assume it is correctly interpreting the settings in linker_flash.rd.
How to solve this issue? I would be grateful for any tips.