How to Flash new program using GPRS module with FTP method?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Flash new program using GPRS module with FTP method?

1,156 Views
athmesh_n
Contributor IV

Hi,

I'm working on LPC1754, I'm using FTP to download the binary file. 

What I would like to know is:

1. How to load the code to the main memory?

2. Can I load the new program stored in SPI flash to the main memory?

3. Should I use Xmodem, Ymodem or Zmodem protocol to load the new program?

   a. if so how to do CRC checking?

   

Please provide me an application note if there's any. Your response will be helpful. 

Thanks,

Athmesh Nandakumar

Labels (3)
6 Replies

986 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Athmesh,

Unfortunately there isn't any example to do this using FTP method, the MCU has the capability of ISP programming through UART, SPI and I2C, you can find more information in the Chapter 32: LPC176x/5x Flash memory interface and
programming in the user guide.

Also there's examples of Bootloader SPI/I2C that could help you implement this:

Best Regards,

Alexis Andalon

986 Views
athmesh_n
Contributor IV

Hi Alexis Andalon‌,

I've worked on FTP and used the UART to download the data to the on-chip flash of LPC1754. All I'm left is with Bootloader. The program should automatically load the new program flashed on to the on-chip. 

The normal procedure is by Resetting the chip. I would like to know how the Bootloader calls the new firmware from a different location. 

0 Kudos

986 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Athmesh,

This is a code found in the MCUBoot but the same should work for your application:

Disable_peripherals_used();


// we need to ensure the values we are using are not stored on the previous stack
static uint32_t s_stackPointer = 0;
s_stackPointer = stackPointer;
static void (*farewellBootloader)(void) = 0;
farewellBootloader = (void (*)(void))applicationAddress;

// Set the VTOR to the application vector table address.
VTOR = (uint32_t)APP_VECTOR_TABLE;

// Set stack pointers to the application stack pointer.
__set_MSP(s_stackPointer);
__set_PSP(s_stackPointer);

// Jump to the application.
farewellBootloader();‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Best Regards,

Alexis Andalon

986 Views
athmesh_n
Contributor IV

Hi alexisandalon‌,

Please send an application note for reference! An example source code will be helpful.

Thanks and Regards

Athmesh Nandakumar  

0 Kudos

986 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Athmesh,

I found a pretty similar implementation using a Ymodem but for the LPC546xx MCU. Check the link here and look for the LPC5460x UART Secondary Bootloader using YModem document.

Best Regards,
Alexis Andalon

986 Views
athmesh_n
Contributor IV

Hi Alexis,

Very thanks for the reply!

I'll check this method for bootloader!

Best Regards,

Athmesh Nandakumar

0 Kudos