Thanks all for your response.
@JohnnyK
I understand and congratulations on the new job position and the interesting project!
-
About baremetal
Thank for the explanation. From this (Mbed OS bare metal profile - Mbed OS bare metal profile | Mbed OS 6 Documentation) I assumed that the core RTOS is also bare-metal and e.g. Mutex are enabled by default.
I have tried to add it in configuration json: “requires”: [“bare-metal”, “events”, “rtos-api”, “drivers-usb”],
but without change - the problem is not in mutex…
-
About USBSerial
I tried to set up the console to my USB port as you recommend:
#include "USBSerial.h"
FileHandle* mbed::mbed_override_console(int)
{
static USBSerial USB_port(true, 0x1f00, 0x2012, 0x0001);
// blocked true
return &USB_port;
}
I lost the ability to send myself my messages - I had to disable them.
It doesn’t go together, however the 1 minute from when it crashes I estimated using the signal LEDs on the board.
I guess that worked, right after connecting I got a message on the console “Cannot initialize UART with baud rate 9600”. (I honestly have no idea what this refers to.)
I was expecting to get some sort of crash report after that minute when I trigger a crash with an incoming UART message, but I received nothing
I tried to add to the mbed_app.json configuration
"platform.crash-capture-enabled": true,
but it is not possible:
Error: L6218E: Undefined symbol Image$$RW_m_crash_data$$ZI$$Base (referred from BUILD/NUCLEO_L433RC_P/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o).
@MultipleMonomials
- I changed the stdio setting to:
"platform.stdio-minimal-console-only": false,
"platform.stdio-buffered-serial": 1,
I hope that it is OK now.
-
Unfortunately I don’t have a full connector on the board for ST-Link connection. There is only SWDIO and SWCLK. However, it looks like as I write above I managed to redirect console to my USB, although I didn’t get the information I would have expected
In a pinch of the highest I can unplug the chip on UART2 and use it for the console or from try just connecting to the UART2 testpads and hope that the chip doesn’t affect communication…
-
I managed (and I really have no idea what change in mbed_app.json led to this, because it didn’t work before) to make the ST-Link connection to MBED and set it as Target. And compile it without error - before that I always got a message that the target is not supported.
This allowed me to run a debug and see what happens when an error occurs.
The crash occurs at the end of the sequence when I return the value (in debug mode I even get it on the USB, in real mode I don’t).
}
}
USB_port.write(&TXbufferUSB, USB_buffer_TX_length);
// HERE IT CRASH
sprintf(systemUSBmessage, " \n"); USB_SendSystemMessage();
}
But always only after a part of the
if(flag_every_60s) // every 60s
{
// here I have the code as seen in the source above,
// but I have tried to delete everything and leave only the empty part {}.
// The effect is the same - even passing the empty part leads to a subsequent crash.
}
Before that, it works 60 seconds without problem.
The Debug Console returns the information to me:
Program
received signal SIGSEGV, Segmentation fault.
0x080001a8 in HardFault_Handler ()
It’s better than nothing, but it didn’t help me much…
It may be some mismatch between RC and RC-P and the compiler after all? Respectively, how is it that with ST Link connected I can have Target STM32L433, when in the directories I only see the folder TARGET_STM32L433xC and the only subfolder TARGET_NUCLEO_L433RC_P.
BR Lukáš