Hi, I have a custom board where I am using a LPC2136.
I am using a JTAG J-link to program the board and it works great, however as soon as I try to run the programmed code by applying power to the board without the debugger attached nothing happens. If I disconnect the debugger while the board is running it continues to operate correctly. I am using the following configuration:
RTCK is pulled down in order to enable the JTAG
P0.14 is pulled up in order to disable the bootloader
P0.31 is pulled up to prevent the mcu in disabling the JTAG port upon reset
The RESET pin is connected to JTAG (with pullup) and to a voltage monitor through an AND gate.
The clock is provided by an external 20MHz crystal.
I would greatly appreciate any ideas or suggestions!
I found the Debug/Release switcher in IAR Workbench, but it doesn’t seem to make any difference. There is a project option under “Options->Linker->Config” to choose a linker configuration file where I can either choose “Flash.icf” or “Ram.icf” which has something to do with code placement inside the device, as there is a matching option in “Options->Debugger->Setup” where I can choose between “Flash.mac” and “Ram.mac” files. The IAR Workbench Still doesn’t have a “Download” button, only “Download and Debug” and “Debug without downloading”. I have tried to generate a .hex file, unsolder the pullup from P0.14 and download it onto the chip manually (flash magic) through a serial connection with the same results.
Does anyone with a bigger insight into IAR Workbench know how to configure it correctly?
I might do so, it would just be nice if some of you guys had experience something simialar and had a quick hint.
I thought I had some kind of a hardware bug, but I think I have tracked it down to the workbench settings. I found out that the debugger places the code in the RAM instead of Flash, which means that the code can be ran if I restart the controller manually without deasserting the power. As soon as the power goes the code dissapears. I tried to change the code placement location by using Flash.mac, but somehow it fails. Seems to me that IAR supplied a currupt Flash.mac file.
As far as I can se there is no .icf file for the LPC2136. The .icf file used in the provided example project is for some other controller from the same family. I have tried to modify the memory ranges in the file to match the device memory map, however without any luck.
I have now written to IAR’s support and asked them for assistance on the matter.