Content originally posted in LPCWare by bavarian on Wed Nov 21 10:24:02 MST 2012
See my comments below:
M0 project questions
1.
Target device is generic ARM Cortex-M0. When I start a dual core project from scratch,
should I select the generic M0 or should it be some NXP part?
--> Generic M0
2.
IROM1 start address is 0x18000000, size is 0x200. According to the LPC43 user manual that area
is reserved. IRAM1 and IRAM2 are also in the same reserved area. Should these settings be always
used to the M0 project?
--> I'm pretty sure that this project works with scatter files and not with the settings in the target tab. So whatever is inserted in these fields, it's not used anyway. And 0x1800000 is indeed no SRAM area which can be used.
3.
I am able to build and debug the M0 project alone. Which CPU is used in this case, is it the M4?
--> if you compile for an M0, if you selected the M0 core in the debugger tab, if you start the debugger, then of course you work with the M0.
M4 project questions
4.
Target device for the M4 project is LPC4350, I'm using 4357, should I change the target device
setting to LPC4357?
--> For the compiler this is a don't care. If you select the target from the list of NXP devices you get some pre-settings for memory areas (which you don't need because you work with scatter files) and the registers are listed in the debugger if you like. So change it to LPC4357, ignore the memory areas which are filled into the fields of the target.
5.
There is no IROM defined for the M4 project. Are the IROM settings important at all?
--> same thing: please always check if the memeory areas are defined in this tab or in a scatter file !!!
6.
When the debugger is started for M4 project (LPC43xx_M4_internal_flash target) and then stopped
(the debugger session is ended without executting any lines in the program) it cannot be restarted.
The error message is "ULINK - Cortex-M Error. Could not stop Cortem-M device! Please check the JTAG cable".
To restore the debugger operation I need to change the boot config pin state and reset CPU. Why is it happening
every time and how to correct that? In my application P2_7 is high - boot from internal flash.
There is something in platformInit() function that may be causing this but it also happens when that function is commented out.
Best case I am able to start debugging but the program will crash eventually
--> I will check the SW package. Most likely related to the debugger ini scripts
7.
When the LPC43xx_M4_RAM target is selected the M4 project cannot be built due to "!!! M0_ROM_START
not defined, check platform_init.h !!!" error. How to correct that?
--> I will check the SW package.
8.
Sometimes the debugger will not start due to a Memory Mismatch at address 0x1A000004, value 0x9D, expected 0x89.
Manually downloading to flash solves this problem.
--> no idea
Is there a document avaliable which describes how to do a dual core project step by step?
--> No, not yet. But I think it's worthwhile to do it.
But here are some basic thoughts:
- The M4 always starts up the LPC43xx, the M0 is in reset state.
- When the M4 is in its execution area (e.g. the ResetHandler or later) it must provide the start address
for the M0 code to the M0, before taking it out of reset state. Otherwise the M0 runs into HardFaults.
- Again, the M4 is always responsible for setting up the chip and prepare the ground for the M0.
- The M4 and the M0 can execute from any memory region, the way you create the binaries for the respective regions
(linker settings of your M4/M0 projects) and the method you use to program them is fully up to you.
e.g. M4 code in flash bank #A, M0 code in flash bank #B
o create M0 image, integrate it into M4 image, program it into flash as one image
o create M4 image, program it into flash bank #A, create M0 image, program it into flash bank #B
e.g. M4 code in flash bank #A, M0 code runs from SRAM
o create M0 image, integrate it into M4 image, program it into flash as one image, the M4 will relocate the M0 image after
startup from flash into the SRAM execution region (specified by you) for the M0
As you can see there are various ways to set this up, important is to understand the basics, specify the memory map for your own
application and then realize it in your toolchain.
Debugging is a little bit more tricky, because it depends on the debugger hardware/software. But if you either debug the M0 or
the M4 then it should work fine with the common solutions.
Regards,
NXP Technical Support Team