2024-03-22 06:27 PM - last edited on 2024-04-09 06:16 AM by Amel NASRI
Hi All
I working on a data logger code. It is basic at the moment.
1, set a an ISRTimmer for 1sec.
2, When ISR triggered set a read bit in Datalogger register i set up.
3, Next loop thru main i test Datalogger register, if set go to a function and read A0, A1 ports and store back into an array i have set up.
Every time i run this code it completes 5 susessful looit always crashes on the 6th loop in the same spot reading A1.
The Fault has the same sequence. 1, call A1 read, 2, straight to HardFault_Handler. According to the stack it happen straight after the osKernalStart (see attached pic).
I was wondering if this is an ISRtimmer confilct with ADC issue?
Any tips would be greatly appreciated
Set Up;
Portenta H7 (STMH7), VS Code using PIO
2024-05-08 01:54 AM
Hello @DaveBy2
Since the crash always occurs on the 6th iteration when reading from A1, and considering the sequence you've described, could you please verify these points:
If the ADC read is not properly synchronized with the ISR, it could cause a conflict.
If the priority of the ISR is not set correctly, it might interfere with the operation of other critical system functions.
It's possible there's a hardware issue with the A1 pin or the ADC channel associated with it.
Try to simplify your ISR to the bare minimum to see if the problem still occurs. Start with the simplest and most likely causes, and work your way through the possibilities systematically.
If the problem persists, please provide more details on your setting project if possible, attach a ZIP file of your project configuration.