-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix nrf52840 serial mentioned #1021 #1036
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
Conversation
hathach
commented
Jul 17, 2018
- update tinyusb for wanted char
- move usb code into usb.c
- update tinyusb for wanted char - move usb code into usb.c
sorry there is a bit off issue, the current code will swallow the ctrl+c as well, hold on, I will fix it. |
move usb descriptors into usb.c
should be OK now. I am not sure if the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks ok, even though we have to keep our own copy of interrupt_char.c now, but I have a few other comments.
ports/nrf/usb/usb.h
Outdated
#ifndef MICROPY_INCLUDED_NRF_USB_H | ||
#define MICROPY_INCLUDED_NRF_USB_H | ||
|
||
#ifdef NRF52840_XXAA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
ports/nrf/usb/usb.c
Outdated
#include "usb.h" | ||
#include "lib/utils/interrupt_char.h" | ||
|
||
#ifdef NRF52840_XXAA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
ports/nrf/usb/usb.c
Outdated
|
||
void usb_init(void) { | ||
|
||
#ifdef SOFTDEVICE_PRESENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this ifdef is needed, I did the fix for having usb and SD co-exist and no extra code is needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the part when SD is enabled is currently handled inside the stack.
https://github.com/hathach/tinyusb/blob/develop/src/portable/nordic/nrf5x/hal_nrf5x.c#L178
Previously they are all inside in tusb hal, then recent Nordic sdk break non-SD api by introducing nrfx (SD API is more stable). But I think I will move it out of the stack, making the stack more generic. I will take this chance to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all is planned here :D :D
https://github.com/hathach/tinyusb/blob/develop/src/portable/nordic/nrf5x/hal_nrf5x.c#L180
@arturo182 do we define SOFTDEVICE_PRESENT when SD is selected, I couldn't find it within the makefile |
It actually looks like we don't define it, it's defined usually in the Nordic SDK which we don't use. Should probably define it in the Makefile if SD is not empty, because even nRFx checks for it sometimes. |
@arturo182 it is used throughout Nordic code, it is good idea to use it to detect SD existence as well. I think for peripheral that is shared with SD, nrfx will need that to detect if the SD existed. |
btw, could you brief me on how to run a simple ble script e.g advertising something. I will check if changes break anything when the SD is running. |
For sure!
After that you should be able to see a device named |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks @hathach.
@arturo182 can you merge after you approve?
@tannewt I can approve but not merge:
|