Home icon indicating copy to clipboard operation
Home copied to clipboard

M5Stack Core2 v1.1 with M5Core2 nanoframework firmware hangs in nanoFramework.M5Stack.M5Core2 static class constructor (see more info in the comment)

Open alexmiby opened this issue 7 months ago • 6 comments

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

alexmiby avatar May 24 '25 07:05 alexmiby

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

alexmiby avatar May 24 '25 07:05 alexmiby

@AdrianSoundy, Could this be an issue with ADC native driver.

alberk8 avatar May 24 '25 07:05 alberk8

@alberk8 I agree as it seems to work for those versions of M5Core

Ellerbach avatar May 26 '25 13:05 Ellerbach

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.

AdrianSoundy avatar May 31 '25 01:05 AdrianSoundy

@alexmiby if you comment out that line, does the remaining code gets executed?

josesimoes avatar Jun 02 '25 08:06 josesimoes

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.

alexmiby avatar Jun 06 '25 02:06 alexmiby