M5Stack Core2 v1.1 with M5Core2 nanoframework firmware hangs in nanoFramework.M5Stack.M5Core2 static class constructor (see more info in the comment)
Library/API/IoT binding
nanoFramework.M5Core2
Visual Studio version
VS2022
.NET nanoFramework extension version
1.1.280 -- the most recent one
Target name(s)
M5Core2
Firmware version
The most recent one
Device capabilities
No response
Description
M5Stack Core2 v1.1
How to reproduce
No response
Expected behaviour
No response
Screenshots
No response
Sample project or code
No response
Aditional information
No response
The hanging up occurs in nanoFramework.M5Core2 static class constructor in this line:
// Set ADC sample rate to 25Hz
_power.AdcFrequency = AdcFrequency.Frequency25Hz;
So this happens upon any program start whenever M5Core2 nuget is added, before any user code whatsoever is executed.
After the hangup, the only possible course of action is to erase firmware and flash it again using nanoff. The source file is nanoFramework.M5Stack\nanoFramework.M5Stack\M5StackCommon\Core2ToughCommon.cs
@AdrianSoundy, Could this be an issue with ADC native driver.
@alberk8 I agree as it seems to work for those versions of M5Core
That statement just does a I2c read / write to the axp192 power controller, so unclear why it would hang. Not to do with native adc.
@alexmiby if you comment out that line, does the remaining code gets executed?
I tried to put the other values of AdcFrequency, and then it goes past that line further. It's specifically setting the _power.AdcFrequency to AdcFrequency.Frequency25Hz that hangs it up straight away.