Closed korjaa closed 5 years ago
Updating to mbed-os-5.14.0-rc2
still fails on HardFault
++ MbedOS Fault Handler ++
FaultType: HardFault
Context:
R0 : 20002A88
R1 : 00000000
R2 : 08001EF9
R3 : 00000000
R4 : 00000000
R5 : 08013590
R6 : 08013580
R7 : 200022F4
R8 : 08013560
R9 : 00000000
R10 : 00000000
R11 : 00000000
R12 : 00000000
SP : 200022D0
LR : 080008C7
PC : 08001E3C
xPSR : 210F0000
PSP : 20002268
MSP : 10000648
CPUID: 410FC241
HFSR : 40000000
MMFSR: 00000082
BFSR : 00000000
UFSR : 00000000
DFSR : 00000008
AFSR : 00000000
MMFAR: 00000070
Mode : Thread
Priv : Privileged
Stack: PSP
-- MbedOS Fault Handler --
++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x8006073
Error Value: 0x8001E3C
Current Thread: main Id: 0x20001120 Entry: 0x8006F6B StackSize: 0x1000 StackMem: 0x20001B30 SP: 0x100005E0
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=DISCO_L475VG_IOT01A
-- MbedOS Error Info --
= System will be rebooted due to a fatal error =
= Reboot count(=4) reached maximum, system will halt after rebooting
@jamesbeyond
nfc_err_t ret = nfc_process.init();
printf("Initialize: ret = %u\r\n", ret);
@korjaa What do these lines of code return in your run?
Ah, sorry to not include the top part of the log.
Initialize: ret = 16
I got that return value when I was trying to reproduce this problem, but didn't connect the PN512 shield.
@korjaa Did you connect PN512 shield to your device?
Ooo, that's most likely it. I only tried with the DISCO board as the other NFC example worked well with it without additional hardware.
Do you have that shield on your side? Can you test it with it?
Unfortunately I couldn't find any PN512 shields from the office.
without shield would be a main cause to the initialization hard-fault
I'm thinking should we add a note to the readme.md that unlike the EEPROM example, this example doesn't work with DISCO_L475VG_IOT01A
.
I'm not so familiar with NFC, are there any technical limitations why this example shouldn't work with DISCO_L475VG_IOT01A
?
Requirements
Verification of the sample application can be seen on any a smartphone with an NFC reader. After running you will be able to read the tag with an NFC tag reader application.
This example is known to work on boards connected to a PN512 shield.
NFCProcess(events::EventQueue &queue) :
_pn512_transport(D11, D12, D13, D10, A1, A0),
_pn512_driver(&_pn512_transport),
_queue(queue),
_ndef_buffer(),
_nfc_controller(&_pn512_driver, &queue, _ndef_buffer)
SmartPoster example uses PN512 shield. The class created in it is based on this shield drivers. EEPROM example uses M24SR, or probably PN512, so it doesn't need a shield because DISCO_L475VG_IOT01A
has it on board.
Maybe we should change the body of main function in this example to something like this.
int main()
{
events::EventQueue queue;
NFCProcess nfc_process(queue);
nfc_err_t ret = nfc_process.init();
printf("Initialize: ret = %u\r\n", ret);
MBED_ASSERT(ret == NFC_OK);
ret = nfc_process.start_discovery();
printf("Start Discovery: ret = %u\r\n", ret);
MBED_ASSERT(ret == NFC_OK);
queue.dispatch_forever();
return 0;
}
The example itself is working fine with the shield correctly connected, Here is an update on the readme #50
Board: DISCO_L475VG_IOT01A Build command:
mbed compile -m DISCO_L475VG_IOT01A -t GCC_ARM --flash --clean
Log output:crash_dump analysis
addr2line