Jump to content

PC=0x00038a50 Hard Fault


escargot

Recommended Posts

I upgraded to this, too, and since then all I get is "Hard Fault at PC=0x00048f30". Sadly in my case, it doesn't go away with a reboot. I intend to try and set the jumper on the core to "enforce bootloader mode at start up", as I can't access the Core over MIOS Studio, and try to upload the older Software version again.

Link to comment
Share on other sites

:-(

 

Could you please check if this also happens with the latest pre-release version?

-> http://www.ucapps.de/mios32/midibox_seq_v4_089_pre5.zip

 

Which core module are you using?

If it's a MBHP_CORE_LPC17, I fear that it's caused by the stack overflow issue that we had some versions ago, with the result that I've to start to remove features for this core (because of missing RAM space)

 

 

I intend to try and set the jumper on the core to "enforce bootloader mode at start up", as I can't access the Core over MIOS Studio, and try to upload the older Software version again.

 

yes, this should work to recover the core.

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Just realized nearly the same HardFault issue, but a different PC number. My Seq works with Wilba CS and LPC17 core. Unfortunately don't know when the problem appeared, it happened first yesterday, when I tried with a Vista PC. Strange thing that it occurred only in Vista permanently, but on my old XP it worked fine. Tried with .089 pre5 and pre6 with the same issue. It worked fine with .088. It happened once on the XP with .089 pre5, but I couldn't repeat it. 

I think it can be some USB, delay or power issue, because it always works without USB connection.

 

My box uses a power switch to switch the 5V from USB, the one fault occasion on XP was when this switch accidentally left on, and the box booted right after I connected the USB. On Vista the fault was permanent regardless the powering sequence. More tests are planned with external power.

Link to comment
Share on other sites

Since USB is interrupt driven, it's for me another indicator that the issue is caused by a stack overflow.

I just added too many features which don't fit into the RAM of LPC17 anymore...

 

In order to check if this assumption is true, please try this version:

http://www.ucapps.de/mios32/midibox_seq_v4_089_pre6__undo_disabled.zip

 

I disabled the UNDO function which saves around 1.5k

 

If this version is working stable at your side, I've to think about feature reduction for the LPC17 firmware (because I guess that most LPC17 users would like to get back the UNDO function)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 months later...

Hello,

I just added too many features which don't fit into the RAM of LPC17 anymore...

What is the max allowed size for binary file, which fits into the LPC17 RAM?

resp. Where i know whether the application size in the compiling results will exceeded max size for LPC17 and application data overrides Ram which is used by Heap or Stack?

arm-none-eabi-size project_build/project.elf
   text    data     bss     dec     hex filename
 379020     536   63088  442644   6c114 project_build/project.elf
10000000 B __ram_start
10007b78 B __ram_end
2007c000 D __ram_start_ahb
20083d10 B __ram_end_ahb

 

Edited by Rio
Link to comment
Share on other sites

LPC17 has two RAM banks, one goes from 0x10000000..0x10007fff, and the second from 0x2007c000..0x20083fff

But special care is required for the first bank, because the stack for background task (&IRQs) will be located from __ram_end..0x10007fff. It depends on the application itself how much stack memory is required for the background task, and since the worst case stack usage is difficult to determine, this is typically a source for unintended hard faults.

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi tk,

thanks for Info. So in my case, there are 0x487 Bytes RAM left for Stack usage. Could that be to small? Do you know, how much Stack RAM is (about) needed by mbseqv4 for lpc17?

is there any way to shink Applications Data e.g. by using optimization Flag -o1..4 for mbseqv4 project, to Save more RAM ?

greetings, Rio 

Edited by Rio
Link to comment
Share on other sites

No, I don't know exactly how much stack memory is required. Once we touched the limit, users will typically complain about hard faults, which tells me that the last feature consumed too much RAM...

If you want to be at the secure side, take the current __ram_end as the one which shouldn't be exceeded

There is no optimization flag which would allow to reduce the RAM consumption, the only way is to remove existing features, or to use one of the newer cores (such as MBHP_CORE_STM32F4)

Best Regards, Thorsten.

Edited by TK.
Link to comment
Share on other sites

hi tk,

ah ok, so last release is 0.89. Your Log File tells me:

 372964        528      63008     436500      6a914    project_build/project.elf

So application size should not exceed 0x6a914 for me at time.

Thanks for your thoughts.

Greetings,

rio

Link to comment
Share on other sites

It isn't that easy, because you've to differ between ROM (=flash) and RAM, and especially for LPC17 between the lower and upper RAM bank.

Before overcomplicating things: check the RAM pointers, ignore other sizes.

Best Regards, Thorsten.

Link to comment
Share on other sites

you mean this information of v0.89 logfile is more interessting:

10000000 B __ram_start
10007b28 B __ram_end
2007c000 D __ram_start_ahb
20083d08 B __ram_end_ahb

especially the __ram_end 10007b28 as max value?

Greetings,rio

Edited by Rio
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...