AssertionFailed error when calling device.select(10)
-
Hello,
I am trying to add support for a custom SPI controlled LED on a Duet2 Ethernet
and a Duet3 MB6HC. But whenever i try to configure the LED output the Firmware reboots with an assertionFailed error.
I have copied the configuration steps of the SPI bus from the PT100 temperature sensor as good a I can but it seems that the device is not declared correctly
LynxMod.h
LynxterLED.cppI tried to comment out certain lines to see which ones causes the error to occur so far it seems that it's the mutex that seems to fail to lock. Am I missing an important step or just way out from my approach.
Also could you give me some pointers on how to debug such issues from now on?
Thanks in advance for the help
-
@tcamguil you will need to use the stack trace in the M122 report to debug this. The first item (0x599) is the line number of the assertion statement in the file and the second is the offset of a string in the compiled code for the file that contains the assertion. You can use the map file to identify which file this string is in.
PS - are you certain that you are not attempting to call the SPI transaction code from the RRF initialisation code, before the shared SPI device and its mutex have been initialised?
-
I was indeed initializing the LED class before the initialisation of the shared SPI device
Thank you for your answer
-
@tcamguil glad to help, I'll mark this as solved.
-
-