Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented Feb 25, 2021

This PR improves the USBCDC speed of nrf52840.
The atsamd5x version is #1481 .
The atsamd2x version is #1636 .

  • 13 byte : fmt.Printf("hello world\r\n")
    • old : 631 us
    • new : 64 us
  • 11 byte : println("hello world")
    • old : 320 us
    • new : 15 us
  • 1024 byte + "\r\n"
    • old : 28.746 ms
    • new : 1.249 ms
  • 1024 * 10 byte + "\r\n"
    • old : 515.017 ms
    • new : 12.746 ms

windows 10 + feather-nrf52840

@sago35
Copy link
Member Author

sago35 commented Feb 25, 2021

Even in the unmodified version, it often crashes immediately after tinygo-flash.
When it crashes, I sometimes get the following message

panic: runtime error: goroutine stack overflow

After resetting several times, the problem will no longer occur.

@deadprogram
Copy link
Member

Once thing I have noticed is that you really need to update nrf52840 bootloader to the latest version from Adafruit (0.4.0) to avoid issues with flashing. See tinygo-org/tinygo-site#143 for info on how to do this.

@sago35
Copy link
Member Author

sago35 commented Feb 25, 2021

Updated to 0.4.1.
When jlink is not used, there seems to be no problem.
After writing from jlink, it looks like I need to perform a reset several times myself.

@deadprogram
Copy link
Member

I have not tried to use jlink on this board, but that does not entirely surprise me. Might need an issue reported upstream to the bootloader repo.

@deadprogram
Copy link
Member

Absolutely works better/faster @sago35 thanks for working on this! Now merging.

@deadprogram deadprogram merged commit e76729c into dev Feb 25, 2021
@deadprogram deadprogram deleted the improve-usbcdc-nrf52840 branch February 25, 2021 12:39
@deadprogram
Copy link
Member

I meant to squash this first, but was too quick on the click. Sorry about that.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants