Hi all,
I have a strange problem. First some dtails:
Processor: MKV58F1M0xxx24 (NXP Arm Cortex-M7)
Compiler/IDE: MCUXpresso
Debugger: J-Link
Here is the relevant code:
/* Initialization function */
void vInitSupervisoryControlTask(void) {
printf("In vInitSupervisoryControlTask\n");
initEventGroups();
vCreateTimers();
The CreateTimers function is as follows:
void vCreateTimers(void) {
xTimerShutdownBrake = xTimerCreateStatic(
"Shutdown & Brake", // Just a text name, not used by the RTOS kernel
pdMS_TO_TICKS(TIMER_PERIOD_SHUTDOWN_BRAKE * 1000), // Period
pdFALSE, // Auto-reload
(void*)0, // ID (a count of the number of times the timer has expired)
vCallbackShutdownBrake, // Callback function
&xTimerBufferShutdownBrake // Address of a StaticTimer_t variable
);
xTimer10RPMRotation = xTimerCreateStatic(
"10 RPM Rotation",
pdMS_TO_TICKS(TIMER_PERIOD_PERIODIC_ROTATION * 1000),
pdFALSE, // One-shot timer
(void*)&xTimer10RPMData, // Pass data for 10 RPM
vCallbackPeriodicRotation, // Callback function
&xTimerBuffer10RPMRotation // Static buffer
);
xTimer0RPMRotation = xTimerCreateStatic(
"0 RPM Rotation",
pdMS_TO_TICKS(TIMER_PERIOD_PERIODIC_ROTATION * 1000),
pdFALSE, // One-shot timer
(void*)&xTimer0RPMData, // Pass data for 0 RPM
vCallbackPeriodicRotation, // Callback function
&xTimerBuffer0RPMRotation // Static buffer
);
// Ensure timers are created successfully
if (xTimer10RPMRotation == NULL || xTimer0RPMRotation == NULL) {
// Handle error: Timer creation failed
}
else {
//NOTE: Printing here causes semihost_hardfault
// printf("Timers created\n");
// vTaskDelay(pdMS_TO_TICKS(5000));
}
}
At the moment I have only 4 tasks running but a lot more have been coded (I switch them off by not calling their init functions).
Why could there be a semihost_hardfault?