ARMmbed / ARMmbed/dapjs

First 64 incoming serial bytes lost after power cycle of Micro:bit

Open
#72 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
134
Forks
56
PR merge metrics
No merged PRs in 30d

Description

After the power cycle, the first 64 incoming serial bytes get lost. serialRead replied nothing. I've confirmed with a USB analyzer, The second byte of the response to the command 0x83 is always zero with a meanless payload. After the first 64 bytes, things get normal.

Here is how I trigger this bug in Micro:bit:

Using Interface Version: 0253 and hex file https://github.com/microbit-foundation/microbit-firmata/blob/master/precompiled/microbit-firmata-v1.0.hex

Open https://deqingsun.github.io/webUSBTest/stuff/testMicrobitDataBug/web.html in Chrome. Replug Micro:bit. Click "connect", and then click "requestFirmataVersion". The webpage will send ```F9 00 00``` and nRF51 chip replies ```F9 02 06```. The response can be captured on TP15, TGT_TX. But DAPJS can not read anything until the 22nd time you click, and the last 2 bytes are returned.

![Screen Shot 2020-05-11 at 7 21 55 PM](https://user-images.githubusercontent.com/1385273/81628345-709b6680-93ce-11ea-933b-8ee3454b8b0f.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the linked web.html in Chrome using the specified micro:bit firmware, then trace the serialRead path in dapjs while issuing the 0x83 request. Done means the response is readable immediately after reconnecting and the first 64 incoming bytes are no longer lost.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.