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

Thingy91 USB-UART bridge #1011

Merged
merged 2 commits into from Sep 19, 2019
Merged

Conversation

bjda
Copy link
Contributor

@bjda bjda commented Jul 31, 2019

This PR contains the firmware intended to run on the nRF52840 on the Thingy:91, and updated board support for the same.

@CLAassistant
Copy link

CLAassistant commented Jul 31, 2019

CLA assistant check
All committers have signed the CLA.

@carlescufi
Copy link
Contributor

I wonder if this should be in applications/thingy91/usb_uart_bridge instead, since it seems specific to that board. If this is to become a generic USB to UART bridge for any board, and will be configurable to work on any board (for example 52840), then we can leave it where it is.

@bjda
Copy link
Contributor Author

bjda commented Aug 1, 2019

@carlescufi It was developed for the Thingy:91, but the code itself is generic, as long as the device is Nordic, and has a UART and USB device. It should be configurable for something like the nRF52840 DK or dongle down the line.

Copy link
Contributor

@jhn-nordic jhn-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have been proven to work on the Thingy:91 for a while now.

Copy link
Contributor

@lemrey lemrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay, left a few comments. If this can indeed run on other boards, I think it should be put under /samples rather than /applications.

applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
@bjda
Copy link
Contributor Author

bjda commented Sep 2, 2019

@lemrey could you revisit?

Copy link
Contributor

@lemrey lemrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better, left a few comments (remember to squash the commits).
You should add a yml file to the project directory and we should decide on the location.
If you say this will support more than one board in the future it would make sense to move it under samples, otherwise we can leave it here. I think it would be useful to have it run on another board.

applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/usb_uart_bridge/prj.conf Outdated Show resolved Hide resolved
applications/usb_uart_bridge/prj.conf Outdated Show resolved Hide resolved
applications/usb_uart_bridge/prj.conf Outdated Show resolved Hide resolved
@bjda bjda force-pushed the pca20035_bridge branch 2 times, most recently from 0a58f7d to d464df9 Compare September 12, 2019 10:15
@bjda
Copy link
Contributor Author

bjda commented Sep 12, 2019

@lemrey All right, handled the comments. Regarding the location in NCS, these are my thoughts after some deliberation:

I see two development paths for this app:

  1. Adding more functionality specific to the shipped Thingy:91 firmware (combining UART bridge, BLE HCI, using the onboard SWD interface, extra I/O, maybe more). This would probably make sense to put in something like applications/thingy91/thingy91_interface, so as not to restrict it to a UART bridge by name.
  2. Adding configuration support for more boards as a generic USB-UART bridge. This would make more sense to put in samples.

There is value in both options, but I propose we start with applications/thingy91/thingy91_interface for now. That will allow the Thingy:91 project to start building product releases for the nRF52 from a consistent location in the NCS.

Since a UART bridge is generally useful for other projects or a standalone sample, maybe we should over time make a configurable subsystem for it (not unlike the at_host library) with its own sample.

Would be great with some input from @jtguggedal and/or @joakimtoe as well on this.

Copy link
Contributor

@lemrey lemrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with leaving it under /applications if we don't want to support other boards for now.
Do you plan to move this to /applications/thingy91/... ?

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 16, 2019

All checks are passing now.

Review history of this comment for details about previous failed status.
Note that some checks might have not completed yet.

@bjda
Copy link
Contributor Author

bjda commented Sep 16, 2019

@lemrey Handled comments and moved to applications/thingy91/usb_uart_bridge

Also increased the power management thread stack up a bit (to CONFIG_IDLE_STACK_SIZE) as this fixed some crashes. The rationale behind using that macro is that it is the configured stack size for doing almost nothing except being ready for interrupts/preemption/logging/etc, which matches the power thread.

@bjda bjda requested a review from lemrey September 16, 2019 17:18
Copy link
Contributor

@lemrey lemrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing all the comments 👍

@lemrey
Copy link
Contributor

lemrey commented Sep 17, 2019

Added entry to changelog.

Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, one nitpick to fix.

applications/thingy91/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
applications/thingy91/usb_uart_bridge/src/main.c Outdated Show resolved Hide resolved
Copy link
Contributor

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a bit of documentation, a bare minimum at least.
Also I would move it to applications/usb/usb_uart_bridge

Copy link
Contributor

@jtguggedal jtguggedal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about license, otherwise looks good to me.
I've been running the application reliably for several hours without issues. MCUboot part of it has not been tested, though.

@bjda
Copy link
Contributor Author

bjda commented Sep 18, 2019

Added doc and moved to samples, as per internal discussion

Copy link
Contributor

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your patience

@jtguggedal
Copy link
Contributor

One last nit: After moving it to samples, the commit title could be changed to reflect that

jtguggedal and others added 2 commits September 19, 2019 16:29
Adjust board configurations to be similar to PCA10059, which
also uses MCUboot over CDC ACM.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
Adds USB to UART bridge intended for PCA20035.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
Signed-off-by: Bernt Johan Damslora <bernt.johan.damslora@nordicsemi.no>
@bjda
Copy link
Contributor Author

bjda commented Sep 19, 2019

Fixed missing entry in TOC and commit name. Should be ready to merge now

@carlescufi carlescufi merged commit f4c2c52 into nrfconnect:master Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants