Flash problems

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

Flash problems

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Wed Apr 24 19:05:46 MST 2013
Hi All,

I am running Red Suite 4 (NXP) under Windows 7 on the Diolan LPC-4350-DB1 card developing code for a UIP ethernet application.

The project runs fine on internal memory. If I run the flash utility, the program runs after the flash is completed. If the card is then powered off and on, the stored program does not restart until I run Debug.

Halting the program running under Debug, the addresses seem correct and show that the program is indeed running from flash.The program is not large:

text data bss dec hex
41720 128 10340 52188 cbdc

I have a version of EasyWeb that works fine from flash on the same card as does LPC4350A_HitexA4_Twinkle_SST, so it looks as if the flash itself is OK.

Once again, any ideas or help would be appreciated.

John.

I should add that I have searched the archives without success.
0 Kudos
5 Replies

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Thu May 02 17:56:09 MST 2013
Hi,

Thank you both for your helpful replies.

The Release version of the code is now finally working from flash memory, whereas earlier it would work only in RAM. Initially, the flash versions were loaded as Debug and would run OK but only when the debugger was connected, which, on connecting, took the system out of the HardFault_Handler. The other projects on my system, compiled similarly, ran normally from flash in both Debug and Release modes.

The project is set up with the "no-host" option.

Today, I recompiled for Release mode, reloaded the flash and everything now works as it should, with or without the debugger connected.

In the disassembly files of all of the other projects in my system thatI looked at, the ResetISR follows immediately after the .bss section. In the present project this is not the case, but this does not seem to have been the cause of my apparent problems. I am still curious as to why the ResetISR code was not placed after the .bss, so any thoughts or references would be welcome.

Thank you both again.

JohnR.
[B]
[SIZE=2]

[/SIZE]
[/B]
0 Kudos

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Apr 30 18:51:09 MST 2013
Are you using any semihosting (printf etc) as the requires a debugger to be connected.
0 Kudos

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Tue Apr 30 18:46:55 MST 2013
Hi Code Red,

The following are abstracted from the disassembly files, the first a project that works fine, the second that does not. In the example that runs OK

In the first case ResetISR follows right after the initial instructions

 
LPC4350A_HitexA4_Twinkle_RAM
Disassembly of section .text:
 
1c000000 <g_pfnVectors>:
..............................
 
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start 
address 0x1c0001b1
......................................
1c000000 
<g_pfnVectors>:
..............................
1c00019c 
<bss_init>:
......................................
......................................
1c0001aa: 4770      
 bx lr
 
 
1c0001ac 
<ADC0_IRQHandler>:
1c0001ac: e7fe      
 b.n 1c0001ac <ADC0_IRQHandler>
 ...
1c0001b0 
<ResetISR>:


In the example that seems to hang in the HardFault_Handler, ResetISR does not follow the initial instructions

 
UIP_LPC4350_1
 
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start 
address 0x1c004295
......................................
1c000000 
<g_pfnVectors>:
..............................
1c00019c 
<bss_init>:
......................................
......................................
1c0001aa: 4770       bx lr
 
1c0001ac 
<ADC0_IRQHandler>:
1c0001ac: e7fe      
 b.n 1c0001ac <ADC0_IRQHandler>
 ...
1c0001b0 
<clock_init>:
1c0001b0: b580      
 push {r7, lr}
......................................
......................................
1c004294 
<ResetISR>:
1c004294: b538      
 push {r3, r4, r5, lr}


In the first case, from sources.mk
SUBDIRS := \
src \

In the second case, from sources.mk
SUBDIRS := \
src/uip \
src \
src/lpc4300 \
src/apps/webserver \


Is the address at the start of the disassembly files actually used?
It seems that ResetISR has to follow right after the initial start up code?

I am probably quite on the wrong track, so once again any help would be appreciated.

JohnR.
0 Kudos

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Tue Apr 30 18:35:53 MST 2013
Hi Code Red,

[B][SIZE=2]HardFault_Handler
[/SIZE][/B]
0 Kudos

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Apr 25 01:24:28 MST 2013

Quote: JohnR
Hi All,

I am running Red Suite 4 (NXP) under Windows 7 on the Diolan LPC-4350-DB1 card developing code for a UIP ethernet application.

The project runs fine on internal memory. If I run the flash utility, the program runs after the flash is completed. If the card is then powered off and on, the stored program does not restart until I run Debug.

Halting the program running under Debug, the addresses seem correct and show that the program is indeed running from flash.The program is not large:

text data bss dec hex
41720 128 10340 52188 cbdc

I have a version of EasyWeb that works fine from flash on the same card as does LPC4350A_HitexA4_Twinkle_SST, so it looks as if the flash itself is OK.

Once again, any ideas or help would be appreciated.

John.

I should add that I have searched the archives without success.



From your problem description, it's likely your flash image is missing a copy of an initialized data section to copy into RAM during initialization. This is the only thing that makes sense. This most often occurs if you've used a proprietary section name for a particular data set. The reason your application runs when started by the debugger, is the debugger has loaded it to RAM for you. This doesn't happen when booting from flash.

Here's a link from the Code Red Wiki:

http://support.code-red-tech.com/CodeRedWiki/EnhancedManagedLinkScripts

Regards,

CodeRedSupport
0 Kudos