LPC1833 external SPI flash bootloader

Started by tony567, May 16, 2021, 03:01:12 AM

Previous topic - Next topic

tony567

Hi, there,

   I am not sure if this forum is alive or not, but I have no other way to solve my issue which stucks me more than 2 months cause I am totally a hardware designer, know little about coding, but no one can help me for this.

here my issue is we implement 2 second source external SPI flash IC for LPC1833, so the original bootloader for one time FW updating into flash is nolonger workable for new SPI flash ICs, the situation now is the original bootloader source code has lost, and no one know the next step in my company

now I need help from flash magic,

1. does flash magic have example code for LPC1833 external SPI Flash bootloader?

2. could flash magic support to teach us how to modify the bootloader code for new SPI flash?

3. if flash magic don't support to teach how to modify the bootloader code, is there any reference documents for LPC1833 external SPI flash bootloader?

4. could flash maigc support to teach the steps to set the MCUXpresso IDE v11.3.1_5262 and Keil uVision5 for LPC1833 external SPI flash bootloader code compile?

Andy Ayre

We include an example for the LPC18S37 that uses SPIFI. See the Bootloaders\External Memory\LPCxpresso18S37 folder in the installation. It may work out of the box for you or it may need modifying.

We can customize and test this for your hardware as part of a consulting project - please contact us for a quote info at esacademy dot com.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

krunalrao

I have tried the same example (\Flash Magic\Bootloaders\External Memory\LPCxpresso18S37) in my LPC1833 board with flash ROM MX25L3233FM2I by changing the descriptor file, but it does not work.

I am new to the LPC18xx controller. In an earlier post, I read that the bootloader code needs to be store in the RAM location not in flash.

How can I find the exact RAM location to store the bootloader code?

I have tried the below code of descriptor, that does not work.

DESCRIPTOR_HEADER,                           // must be DESCRIPTOR_HEADER
  DESCRIPTOR_VERSION,                          // must be DESCRIPTOR_VERSION
  BOOTLOADER_FUNC_BASIC,                       // bootloader functionality (ORing of BOOTLOADER_FUNC_xxx)
  VERSION,                                     // version number of bootloader
  0x80000000,                                  // programmable memory start address
  0x801FFFFF,                                  // programmable memory end address
  0x10000500,                                  // ram start address (for bootloader storage)
  0x10001FFF,                                  // ram end address (for bootloader storage)
  0x1000,                                     // programmable sector size in bytes
  0xFF,                                        // programmable memory erased value
  256,                                         // number of bytes to program at once
  115200,                                      // communication baudrate
  DESCRIPTOR_BOOTSTRAP_CORTEXUART,             // use ISP to download this bootloader
  115200,                                       // baudrate to use for downloading bootloader
  0,                                           // ram address for commmand mailbox (0 = not used)
  0,                                           // ram address for response mailbox (0 = not used)
  0,   

               
Could anyone please provide some details to design the bootloader code?

Andy Ayre

The RAM location is the sixth entry in the descriptor. This is where the interrupt vectors need to start. Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

krunalrao

I have mapped RAM Location with the LPC datasheet and the address is correct only. Really appreciate it, if you can simplify your answer.

Andy Ayre

We provide examples for users to adapt. If you go down the route of adapting then we don't have your changes or your hardware so you will have to debug it yourself. The support for external flash is not plug-and-play because of all of the variables - it's a development task.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

krunalrao

I am very much aware that sample code is not a plug-and-play type.  I believe providing any information on the sample code will be okay for you. In the sample code, in the comment below lines are mentioned.

erasing, programming and verifying of SPIFI flash S25FL129P on
// Hitex LPC1800/LPC4300 evaluation board
// Adapted from code in NXP SPIFI Read/Write example
// see: http://sw.lpcware.com/?p=lpc18xx.git&a=tree
// $Id: FlashPrg.c 3895 2015-05-14 13:06:10Z andy $

I am not able to log in to this mentioned website. Do you have an NXP link for the same?

I assume that this andy is you only. S? now below is my main concern.

How can I find the exact RAM location to store the bootloader code.

I have tried the below code of descriptor, that does not work.

  0x80000000,                                  // programmable memory start address
  0x801FFFFF,                                  // programmable memory end address
  0x10000500,                                  // ram start address (for bootloader storage)
  0x10001FFF,                                  // ram end address (for bootloader storage)
  0x1000,                                     // programmable sector size in bytes
  0xFF,                                        // programmable memory erased value
  256,                                         // number of bytes to program at once
  115200,                                      // communication baudrate
  DESCRIPTOR_BOOTSTRAP_CORTEXUART,             // use ISP to download this bootloader
  115200,                                       // baudrate to use for downloading bootloader
  0,                                           // ram address for commmand mailbox (0 = not used)
  0,                                           // ram address for response mailbox (0 = not used)
  0,                 

To clear more, I am not asking something that I need to develop. I am asking which is already there in the sample code.

Looking forward to some detailed explanation!!!

Thanks in advance!!

Rao

Andy Ayre

You don't find the RAM location, you choose the RAM location. You can put the bootloader at any location in RAM that you wish. The only requirement is that the start address in the descriptor matches your linker map file. The descriptor tells Flash Magic where in RAM to download the bootloader to and start execution from.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com