-
Notifications
You must be signed in to change notification settings - Fork 1.3k
nrf: implement busio.UART #1039
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
Comments
While working on uart, @arturo182 is it ok now if I remove the macro that use the jlink cdc instead of native cdc. That option is there for you only :) |
Which cdc do you mean? |
the jlink cdc that uses the hwuart on pca10056 CFG_HWUART_FOR_SERIAL |
Yes, it's fine to remove that :) |
anyone knows this function got called, or it is called by system |
ah ha, I figured it out, |
@dhalbert the default uart for pca10056 should be P0.8 and P0.6 instead of P1.1 & P1.2. It is connected to jlink cdc allow for quick testing. Furthermore if jlink cdc is not connected, those pins are in tri-state, which is safe to use with other device. Please let me know if I missed something. |
Ah, I see, seem like you want to keep the pin compatible with Arduino layout :D . Sorry, didn't realize that until I check the pcb |
@hathach right, exactly. |
Leave it to gc. It is allocated by |
ah thanks, this new to me, I will just skip the free for nrf52 as well. |
probably the same hw issue that I encountering. The first 2 irq uart request will fail miserably without real reason. UART is not too easy after all ~ . ~ |
@hathach that devzone post is very confusing. I wonder if that's the PDK board. |
@dhalbert that is what I am seeing here as well with my board. At least I know why it doesn't work out the way I think. Using bare-metal is much easier for busio in comparison with the nrfx_uart. Though, I am getting it done by just ignoring first 2 irq error |
@dhalbert If you have time, I could push the code for you test there before I clean them up. |
i could try it with a GPS |
You don't need extra hw to test since only the write() work now. The bug prevent me to do subsequent receiving since it failed at the beginning. here is the code Just run u.read() : this will printf the previous error and call nrfx_uart_rx() again. To test with u.write() you can hook up FTDI cable, it should work.
|
Are you using UART or UARTE? |
I asked for more info in that DevZone case. |
UART since the rest of repo use it. UARTE is just having DMA to move data into buffer, not really needed for cpy I guess. Also the DMA demands data must be on the SRAM, flash address (i.e global const [] ) won't work. I am not sure if cpy use any of those. |
What exactly is the error you are getting? Is this relevant? https://devzone.nordicsemi.com/f/nordic-q-a/37521/nrf52840-usb_cdc_acm-uart/145013#145013 I saw one DevZone case that recommended using UARTE over UART in nrf52832, but now I can't find it again. |
error 4 (frame ) then error 8 (break). oh way, I think I found my own error lol, let's me test a bit more. |
facepalm, I just assign the txd 2 time :( . That is high price to pay here Sorry for your time with my stupid mistake @dhalbert |
no problem, but time to sleep! |
Do you prefer UARTE to UART, I could upgrade it to UARTE. Though, you must make sure all data is in SRAM not flash, and we must malloc buffer if needed. I think it is not really gain much benefit, since the uart is slow, cpu time for moving data is not much at all. |
No, I don't prefer, just thought that UARTE might not have the problem, and now it's moot. |
uart io should be done, I will hook an GPS wing to test tomorrow. Phew, too much time for the easy uart. Hopefully there is no more bugs :D |
I'm rethinking UARTE vs UART: Advantage of UARTE is that there are two instances on '840, so we can have more than one UART channel. I understand the issue of of EasyDMA not working from flash, though we can copy to RAM. Also UART is deprecated, though I don't understand how significant that is. If there were a 58x0 after the 5840, maybe they'd drop UART? |
No problems, I will make the switch. the flow is similar to what I am doing anyway. IRQ vs DMA only has diff that cpu must move the data manually. But I think I will test what I have first before switching. I will also update the serial.c as well. currently serial.c use polling method, so there should be no impact at all. |
DMA can be a bit faster even when we poll because it runs even when the cpu
is handling an interrupt.
…On Fri, Sep 21, 2018 at 7:13 AM hathach ***@***.***> wrote:
No problems, I will make the switch. the flow is similar to what I am
doing anyway. IRQ vs DMA only has diff that cpu must move the data
manually. But I think I will test what I have first before switching. I
will also update the serial.c as well. currently serial.c use polling
method, so there should be no impact at all.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1039 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADNqbrQ7K8wYi3d_Kk4BNTMXXpXDtDBks5udJGEgaJpZM4VS-Px>
.
|
@tannewt yeah, I am moving it to uarte now. |
Ok great!
…On Fri, Sep 21, 2018 at 6:03 PM hathach ***@***.***> wrote:
@tannewt <https://github.com/tannewt> yeah, I am moving it to uarte now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1039 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADNqUL0aV9z9JozlgoucG6T0-u5eUl8ks5udSntgaJpZM4VS-Px>
.
|
Still to implement:
@hathach I will take these up later. |
This has been done right? |
its been solid so far, @jerryneedell has done the most testing |
It’s been working great on the particle boards |
It only provides one UARTE, and there are two available. Not sure the |
Nope, no |
oops - sorry about the premature close... |
Yes, I thought it was going to get closed automatically. |
It's not super smart about how when it knows to close: https://help.github.com/articles/closing-issues-using-keywords/ |
No description provided.
The text was updated successfully, but these errors were encountered: