Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of I2C on Netduino 3 Wifi causes execution to stop at I2cDevice.FromId #627

Closed
KiwiBryn opened this issue Jun 17, 2020 · 1 comment · Fixed by nanoframework/nf-interpreter#1677

Comments

@KiwiBryn
Copy link

KiwiBryn commented Jun 17, 2020

Details about Problem

Target: NETDUINO3_WIFI

Firmware image version: 1.5.0-preview.1

Don't know if this has worked before new code

Description

Second time I run program with I2C in debugger on N3W it hangs at I2cDevice.FromId

Detailed repro steps so we can see the same problem

  1. Run program in debugger I2C device works as expected can read values etc

  2. Stop program

  3. Run program in debugger again.
    Program hangs at I2cDevice.FromId
    (odd thing is if you single step over this line get long list of "Step into: Stepping over non-user code...")
    Program is actually running as LED is flashing

  4. To get program to run again I had to in device explorer erase deployment, and power cycle device.

  5. goto 1

Other suggested things

I think Something breaks in the debugger connectivity, I think the "NETDUINO3_WIFI @ COM28" item in the "Devices" tab flickers as well.

Expected behaviour

Should be able to start & stop program many times

Screenshot

Additional context

Sample code attached you will need to modify to suit your I2C device, by changing address, and register to one which can be read from(My setup was for SI7002 temperature & humidity sensor).

System Information
HAL build info: nanoCLR running @ NETDUINO3_WIFI
Target: NETDUINO3_WIFI
Platform: STM32F4

Firmware build Info:
Date: Jun 9 2020
Type: MinSizeRel build with ChibiOS v19.1.4.1
Version: 1.5.0.1
Compiler: GNU ARM GCC v9.2.1

OEM Product codes (vendor, model, SKU): 0, 0, 0

Serial Numbers (module, system):
00000000000000000000000000000000
0000000000000000

AppDomains:

Assemblies:
NetduinoClient, 1.0.0.0
Windows.Devices.Gpio, 1.5.1.0
nanoFramework.Runtime.Events, 1.8.0.3
nanoFramework.System.Text, 1.1.0.2
mscorlib, 1.7.3.5
Rfm9XLoRaDevice, 1.0.0.0
Windows.Devices.Spi, 1.3.0.2
SiliconLabsSI7005, 1.0.0.0
Windows.Devices.I2c, 1.3.2.3

Native Assemblies:
mscorlib v100.4.10.0, checksum 0x9D93AC29
nanoFramework.Runtime.Native v100.0.8.0, checksum 0x2307A8F3
nanoFramework.Hardware.Stm32 v100.0.4.4, checksum 0xE171FDE1
nanoFramework.Devices.OneWire v100.0.3.4, checksum 0xA5C172BD
nanoFramework.ResourceManager v100.0.0.1, checksum 0xDCD7DF4D
nanoFramework.System.Collections v100.0.0.1, checksum 0x5A31313D
nanoFramework.System.Text v100.0.0.1, checksum 0x8E6EB73D
nanoFramework.Runtime.Events v100.0.7.1, checksum 0x0EAB00C9
EventSink v1.0.0.0, checksum 0xF32F4C3E
System.Math v100.0.4.4, checksum 0x39DA4F21
Windows.Devices.Adc v100.1.3.3, checksum 0xCA03579A
Windows.Devices.Gpio v100.1.2.2, checksum 0xC41539BE
Windows.Devices.I2c v100.2.0.2, checksum 0x79EDBF71
Windows.Devices.Pwm v100.1.3.3, checksum 0xBA2E2251
Windows.Devices.SerialCommunication v100.1.1.1, checksum 0x82260711
Windows.Devices.Spi v100.1.4.1, checksum 0x59B5BFC3
Windows.Storage v100.0.2.0, checksum 0x5160A7B6

++++++++++++++++++++++++++++++++
++ Memory Map ++
++++++++++++++++++++++++++++++++
Type Start Size
++++++++++++++++++++++++++++++++
RAM 0x200000c0 0x00030000
FLASH 0x08000000 0x00200000

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ Flash Sector Map ++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Region Start Blocks Bytes/Block Usage
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0 0x08000000 1 0x004000 nanoBooter
1 0x08004000 3 0x004000 nanoCLR
2 0x08010000 1 0x010000 nanoCLR
3 0x08020000 1 0x020000 nanoCLR
4 0x08040000 6 0x020000 Deployment
5 0x08100000 4 0x004000 Deployment
6 0x08110000 1 0x010000 Deployment
7 0x08120000 7 0x020000 Deployment

+++++++++++++++++++++++++++++++++++++++++++++++++++
++ Storage Usage Map ++
+++++++++++++++++++++++++++++++++++++++++++++++++++
Start Size (kB) Usage
+++++++++++++++++++++++++++++++++++++++++++++++++++
0x08000000 0x004000 (16kB) nanoBooter
0x08004000 0x03C000 (240kB) nanoCLR
0x08040000 0x1C0000 (1792kB) Deployment

NetduinoI2COddness.txt
Program.zip

@josesimoes
Copy link
Member

Reproduced. There is a hard fault being thrown on CLR reboot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants