Report
3 months, 1 week 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

Comment on this question

1 Answer

3 months, 1 week 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 Surendar S 21 Mar 2017

Watarai-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 Surendar S 21 Mar 2017

Quote:

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 Toyomasa Watarai 22 Mar 2017

Watarai-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 Surendar S 22 Mar 2017

Hi,

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)

}
posted by Toyomasa Watarai 22 Mar 2017

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 Surendar S 22 Mar 2017

Quote:

Shouldnt the OS_MAINSTKSIZE be 64 instead of 128? 1517 has only 64kb ram

Actually, it depends on your application usage for RTOS threads (tasks). You can change this value if your application task require more (or less) stack size.

posted by Toyomasa Watarai 22 Mar 2017

Watarai-San I dont use Mbed RTOS. Let me try with both these values..

Please check your private message

posted by Surendar S 22 Mar 2017

To post an answer, please log in.