LPC 1764 start up problem

rasputin1764 wrote on Tuesday, April 05, 2011:

I loaded the demo of freertos for LPC1768 on LPC 1764, the program works fine, but, if I remove power to the board, at the restart, the program does not work ….for restart the program;I manually restarted it with jtag without redownload the program
I use IAR Workbench and jtag lite.

rtel wrote on Tuesday, April 05, 2011:

Sorry, I can’t help specifically there, but some random thoughts:

+ Did you correctly retarget the 1768 project to the 1764, what are the memory map differences?
+ Does a simple program that does not use FreeRTOS start up ok without having to manually reset through the JTAG?
+ What is the JTAG actually doing?  Normally you have the option to run macros pre and post programming of the flash, and pre and post starting the application, when you run through the jtag.  I think in IAR the macros are stored in a .mac file, you will be able to see if you go to the debug settings in the project file.
+ When the program is started without the jtag, but apparently not running, can you connect the jtag to it without stopping or restarting the program, so you can then see what is being executed through the debugger?


rasputin1764 wrote on Tuesday, April 05, 2011:

Hi, thanks for help, ok, I try to answer point to point:

+Yes i are quite secure that the project is correctly configurated; included the setting of device(LPC 1764).
Only difference in memory map is the start adress of flash memory(0x0000 0000 to place of 0x0004 0000) and the adress of RAM(0x1000 0000 to place of 0x1000 4000)…I think…

+I used the standard files  “LPC17xx.h” and “core_cm3.c/h” for build a simple project for blink a led; and he work fine.

+In IAR the file to contain the macros is Flash.mac:

  __writeMemory32(0x00000000, 0xE000ED08, “Memory”); //Vector table remap at 0x00000000

  // If the MAM values was wrong, a dummy read is necessary to get the flash memory in sync.
  __writeMemory32(0x00000001, 0x400FC040, “Memory”); // MEMMAP = 1
  __readMemory32(0x00000000, “Memory”);
  __writeMemory32(0x00000000, 0xE000ED08, “Memory”); //Vector table remap at 0x00000000

+Sorry; I have J-LINK, not J-tag;  and he no permit me to enter in debug mode without restart the system; Only test I can do, is reset the system in debug mode( because when I push reset button; the system not restart) and the pointer is blocked in:

->  B HardFault_Handler
        PUBWEAK MemManage_Handler
        SECTION .text:CODE:REORDER(1)

in Cstartup_M.s file

rasputin1764 wrote on Tuesday, April 05, 2011:

I use J-Link with J-Link/J-Trace Driver, Run to main flag active and use macro file Flash.mac

rasputin1764 wrote on Wednesday, April 06, 2011:

any idea?

rasputin1764 wrote on Wednesday, April 06, 2011:

Please Richard, help me; I have tried mount on the same board the LPC 1769 microcontroller, after the changes of memory address, the program work fine and restarts correctly….but for the project,I  use the LPC1764 microcontroller….have you any idea, o test for resolve this problem?

rtel wrote on Wednesday, April 06, 2011:

Without studying the datasheets of the parts, inspecting your hardware, and looking at your entire project, I’m afraid to say, there is not much remote debugging I can do.

Normally with these debug interfaces there is the option to attach to a running program without having to reset the device.