[SOLVED] Ozone - Program enters inmediately in hardfault handler after program and start debugging

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Ozone - Program enters inmediately in hardfault handler after program and start debugging

    Hi everybody!,

    I'm new in this forum and using Segger J-Link (i've a J-Link Mini EDU). I have been using J-Link for programming a LPC4337 via SWD without any trouble, using commands in console (connect, h, loadbin, r, g, etc...).

    Now, i want to perform a debug with Ozone, but when i "download and reset" (and run the code), inmediately the execution of the program enters in hardfault handler. The same happens in another uC, so i suppose that it's not a particular problem of the chip.

    My config:
    Device: LPC4337_M4
    Peripherals: using "LPC43xx_43Sxx.svd" that i found on a NXP forum
    Target interface: SWD
    Speed: 4 MHz
    File: using .elf file.

    Any idea of what is going wrong?

    Thanks in advance!
    Regards,
    Mauro.

    Console output (last command Debug.Halt is done by me):

    Source Code

    1. Debug.Start();
    2. Device "LPC4337_M4" selected.
    3. Found SW-DP with ID 0x2BA01477
    4. Scanning AP map to find all available APs
    5. AP[1]: Stopped AP scan as end of AP map has been reached
    6. AP[0]: AHB-AP (IDR: 0x24770011)
    7. Iterating through AP map to find AHB-AP to use
    8. AP[0]: Core found
    9. AP[0]: AHB-AP ROM base: 0xE00FF000
    10. CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    11. Found Cortex-M4 r0p1, Little endian.
    12. FPUnit: 6 code (BP) slots and 2 literal slots
    13. CoreSight components:
    14. ROMTbl[0] @ E00FF000
    15. ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    16. ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    17. ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    18. ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    19. ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    20. ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    21. J-Link: connected to target device
    22. LPC18xx/43xx reset: Halting CPU before performing reset...
    23. LPC18xx/43xx reset: Halted CPU before reset.
    24. Unknown LPC18xx/43xx bootloader variant. Halting after reset may fail.
    25. Elf.GetBaseAddr();
    26. Target.SetReg ("SP", 0x464C457F);
    27. Target.SetReg ("PC", 0x10101);
    28. J-Link: Flash download: Bank 0 @ 0x1A000000: 1 range affected (32768 bytes)
    29. J-Link: Flash download: Total time needed: 0.728s (Prepare: 0.059s, Compare: 0.009s, Erase: 0.439s, Program: 0.215s, Verify: 0.000s, Restore: 0.004s)
    30. Elf.GetBaseAddr();
    31. Target.SetReg ("SP", 0x464C457F);
    32. Target.SetReg ("PC", 0x10101);
    33. Debug.Halt();
    Display All
  • Hello Mauro,

    Thank you for your inquiry.
    The SP and PC seem to take unexpected values.
    Are you debugging an application with e.g. a bootloader?
    If yes the following changes must be done in Ozone to debug an application using a bootloader:
    wiki.segger.com/SEGGER_Ozone#S…g_session_with_bootloader

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Mauro,

    Good to hear that you are up and running again.
    This thread will be closed now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.