Hi, I am trying to run the secondary bootloader demo code using sd-card and flash file system. I picked up the demo code from here: www.nxp.com/.../LPC2000_Series_Secondary_Bootloader.zip In the folder Bootloader_SD. Since it is written for LPC2387, while i am using LPC2138. So, i replaced MMC driver funtions with SPI driver functions. I also changed the UART1 port to UART0 port for (in serial.c) LPC2138 for pc interface. On compiling, only 5 waarnings:
SD\BL_SD.c(279): warning: #167-D: argument of type "U32 *" is incompatible with parameter of type "unsigned long *" SD\BL_SD.c(353): warning: #167-D: argument of type "U32 *" is incompatible with parameter of type "unsigned long *" SD\BL_SD.c(366): warning: #177-D: variable "IAP_return" was declared but never referenced SD\BL_SD.c(554): warning: #167-D: argument of type "U32 *" is incompatible with parameter of type "unsigned long *" SD\BL_SD.c(364): warning: C3017W: sector_size may be used before being set
On running, i can see the menu on Hyper-terminal. I am also able to see the list of files present in the sd-card using DIR command. But when i issue command CMD>> PROG ZCODE.BIN(enter) (Zcode.bin is binary file present in sd-card) it says programing ZCODE.BIN at 0x10000.... and that's it. hangs there......... It does so also on erase command. i.e ERASE 10 20(enter) ...hangs.... Have i missed something. I think the IAP.c file is valid for whole LPC2000 family..
Regards, Salman
Glad to hear it's working. What you did was replace an endless loop with a branch to an actual handler. Before the change a SWI would cause your code to endlessly execute the "B SWI_Hndler" line. After the change a SWI causes your code to jump to the routine "SoftwareInterrupt".