Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 8 months ago.
LPC1549 to LPC1517
Hello All
If I were to use the LPC1549 board but were to move to LPC1517 will it work without much code change if I a) Keep code size under limit and 2) dont use usb functions?
Surendar
1 Answer
7 years, 8 months ago.
Because the LPC1517 has different memory map as LPC1549, it may not work. You need to configure initial stack pointer and vector table etc. Online compiler use pre-build library for the LPC1549, so you need to use offline toolchain.
Watarai-San, Can you kindly let me know how I can change the memeory map stackpointer etc? Which files would it be LPC15xx.c?
Thanks a bunch for your help
posted by 21 Mar 2017They are defineded here: https://github.com/ARMmbed/mbed-os/tree/master/targets/TARGET_NXP/TARGET_LPC15XX/device
posted by 21 Mar 2017Watarai-San
I used the below doc and I dont see a difference between LPC1517 and LPC1549. The document seems to say that theres is only one mem map both of them
http://www.nxp.com/documents/user_manual/UM10736.pdf
Is my understanding correct? Thanks for your help
posted by 21 Mar 2017Quote:
The document seems to say that theres is only one mem map both of them
you have to refer Table 1 (LPC15xx SRAM configuration) and Fig.1 (Memory mapping) in Chapter 1. The LPC1517 has different memory map.
You need to change linker script file (.sct), initial SP value in startup code (.S) for and RTOS config file (mbed_rtx.h).
posted by 22 Mar 2017Watarai-San, Thanks for your help. Would you kindly verify if this is correct? Sorry since I am newbie in this area need your help I am using GCC_ARM offline so no changes to Sct to be done because that looks for ARM_MIRCO?
a) On mbed_rtx.h
I should change INITIAL_SP to 0x02003000UL ? and Change OS_MAINSTKSIZE to 64?
#elif defined(TARGET_LPC1549) #ifndef INITIAL_SP #define INITIAL_SP (0x02003000UL) #endif #ifndef OS_TASKCNT #define OS_TASKCNT 14 #endif #ifndef OS_MAINSTKSIZE #define OS_MAINSTKSIZE 64 #endif #ifndef OS_CLOCK #define OS_CLOCK 72000000 #endif
c) No change to startup_LPC15xx.S on GCC_ARM?
Truly appreciate your help.
posted by 22 Mar 2017Hi,
When you add your source code, please use <<code>>, not <<Code>>
. It is case sensitive.
The INITIAL_SP should be top of RAM area. I recommend to set task count and stack size should be similar as other small target.
#define INITIAL_SP (0x02003000UL) #ifndef INITIAL_SP #ifndef OS_TASKCNT #define OS_TASKCNT 6 #endif #ifndef OS_MAINSTKSIZE #define OS_MAINSTKSIZE 128 #endif
No change startup_LPC15xx.S, since there is no immediate value for SP for GCC version of the startup code. And you need to change linker script file as below:
MEMORY { /* Define each memory region */ FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K Ram0_16 (rwx) : ORIGIN = 0x2000000 + 0x100, LENGTH = (12K - 0x100) }
Watarai-San
Thanks a bunch. It compiles now. I have to wait for a few more days for the hardware to be delivered to me. So soon as that is delivered, we will test this.
Questions: Shouldnt the OS_MAINSTKSIZE be 64 instead of 128? 1517 has only 64kb ram
posted by 22 Mar 2017