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

mbed OS / Nordic nRF51-DK serial port functionality is inconsistent. #2489

Closed
nuket opened this issue Aug 18, 2016 · 8 comments
Closed

mbed OS / Nordic nRF51-DK serial port functionality is inconsistent. #2489

nuket opened this issue Aug 18, 2016 · 8 comments

Comments

@nuket
Copy link
Contributor

nuket commented Aug 18, 2016

Trying to reconfigure the serial port in use by the Nordic nRF51-DK seems to be inconsistent:

If I use the Blinky example as follows, it will not start to output data on pins p12 and p13 of my nRF51-DK board. On mbed Classic, this seemed to work fine, albeit the various issues with non-connected hardware flow control, which seem to be endemic to the Nordic chips.

The method calls to anotherPort end up changing the baud rate of communications to the serial port connected to the /dev/ttyACM0 device, and printing to the mbed ACM device.

#include "mbed.h"

DigitalOut led1(LED1);

Serial anotherPort(p12, p13);

// main() runs in its own thread in the OS
// (note the calls to Thread::wait below for delays)
int main() {
    anotherPort.baud(115200);
    anotherPort.printf("Start.\n");

    while (true) {
        led1 = !led1;

        anotherPort.putc('*');

        Thread::wait(500);
    }
}

Another issue I've seen with this exact code is that the serial data indeed would be emitted via pins p12 and p13 of my nRF51-DK to a receiving device on /dev/ttyUSB0. Yes, that's right, same code, two completely different behaviors.

Also, more troublingly, the board could be induced to hang by playing with the DTR and RTS pins on /dev/ttyACM0. I could have two instances of CoolTerm open, and twiddling those pins in one window would cause the other window to stop seeing asterisks being transmitted.

I'm wondering if this is a static initialization order issue of some kind...

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 18, 2016

cc @pan-

@nuket
Copy link
Contributor Author

nuket commented Aug 18, 2016

Also noticed: with the anotherPort codes in place, LED1 will not start blinking until I connect to the /dev/ttyACM0 development serial port with CoolTerm. The whole system hangs until then.

And after I disconnect from the development serial port, the board will hang again.

@pan-
Copy link
Member

pan- commented Aug 19, 2016

@anangl We need your help on this one.

@nvlsianpu
Copy link
Contributor

Unfortunately NRF5x_DK targets have serial port configured to use flow control - think a good idea is to providing configuration over mbed config system for flow control.(as was mentioned in this conversation #2482). I will try to resolve this issue.

@nuket
Copy link
Contributor Author

nuket commented Aug 24, 2016

Yes, this would be a very good thing to make configurable.

It is, in my mind at least, a pretty insane thing to have an infinite while() loop in the HAL code halt my program because of debug statements, and the current behavior definitely does not follow the path of least surprise.

@nvlsianpu
Copy link
Contributor

#2535

@nuket
Copy link
Contributor Author

nuket commented Aug 24, 2016

Thanks for working on this!

@nuket
Copy link
Contributor Author

nuket commented Aug 30, 2016

Confirmed #2535 fixes this issue when hardware flow control overridden in mbed_app.json:

"target_overrides": {
    "NRF51_DK": {
        "target.uart_hwfc": 0
    }
}

@nuket nuket closed this as completed Aug 30, 2016
artokin pushed a commit to artokin/mbed-os that referenced this issue Nov 9, 2020
…..715ae9a

715ae9a Merge remote-tracking branch 'origin/release_internal' into release_external
42c9807 Nanostak trace level configuration (ARMmbed#2489)
6f52171 Bug fix: socket reference count made 16-bit (ARMmbed#2490)
f51669a Bug fix: Do not print UFSI drift when fixed channel is used (ARMmbed#2488)
18fa048 RPL DAO timeout update:
660e178 Clear debug traces.
cbac0bb DIO init send block for node
fed5d1c Created different MPL configuration based on network size
7ad7e81 Wi-SUN recovery and BR BSI update:

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 715ae9a
artokin pushed a commit to artokin/mbed-os that referenced this issue Nov 10, 2020
…9d9e24..715ae9a

715ae9a Merge remote-tracking branch 'origin/release_internal' into release_external
42c9807 Nanostak trace level configuration (ARMmbed#2489)
6f52171 Bug fix: socket reference count made 16-bit (ARMmbed#2490)
f51669a Bug fix: Do not print UFSI drift when fixed channel is used (ARMmbed#2488)
18fa048 RPL DAO timeout update:
660e178 Clear debug traces.
cbac0bb DIO init send block for node
fed5d1c Created different MPL configuration based on network size
7ad7e81 Wi-SUN recovery and BR BSI update:
d207f4d Merge branch 'release_internal' into release_external
d166c89 MPL: buffered max limit increased to 8k (ARMmbed#2482)
0f6666a Fixed Unit test's
1ff9b1d LLC drop a packet if FHSS shedule is not configured.
7cecc28 Fixed missing asynch trigle setup stop at if down process
7a8b2bf Wi-SUN fhss API default value setting fixes
164a370 Fixed coverity issues from management API
8b5b433 Corrected out of bounds access coverity warning (ARMmbed#2475)
4ffe6a1 Multicast forwarding is separated from the routing flag
30f4315 Wi-SUN discovery staten enter upxdate
083b84e Iotthd 4308 (ARMmbed#2473)
fcc33d5 Removed time increment from NVM time read function on interface up
9c8e3af fhss_tx_handle update
5491a6b Fixed UFSI update print function (ARMmbed#2470)
86f64c5 FHSS WS: Check if BC schedule is stopped before computing timeout delay (ARMmbed#2469)
a0b112a Corrected defects and coding style
2f4678a Corrected trace macro
5e96751 Distributed key storage NVM writes to longer time period
9b3891f FHSS WS: handle blocked interrupts (ARMmbed#2466)
a792e83 Added validation at MAC ack buffer handler
2a465b2 DNS configuration lifetime validation

git-subtree-dir: connectivity/nanostack/sal-stack-nanostack
git-subtree-split: 715ae9a
artokin pushed a commit to artokin/mbed-os that referenced this issue Nov 10, 2020
…..715ae9a

715ae9a Merge remote-tracking branch 'origin/release_internal' into release_external
42c9807 Nanostak trace level configuration (ARMmbed#2489)
6f52171 Bug fix: socket reference count made 16-bit (ARMmbed#2490)
f51669a Bug fix: Do not print UFSI drift when fixed channel is used (ARMmbed#2488)
18fa048 RPL DAO timeout update:
660e178 Clear debug traces.
cbac0bb DIO init send block for node
fed5d1c Created different MPL configuration based on network size
7ad7e81 Wi-SUN recovery and BR BSI update:
d207f4d Merge branch 'release_internal' into release_external
d166c89 MPL: buffered max limit increased to 8k (ARMmbed#2482)
0f6666a Fixed Unit test's
1ff9b1d LLC drop a packet if FHSS shedule is not configured.
7cecc28 Fixed missing asynch trigle setup stop at if down process
7a8b2bf Wi-SUN fhss API default value setting fixes
164a370 Fixed coverity issues from management API
8b5b433 Corrected out of bounds access coverity warning (ARMmbed#2475)
4ffe6a1 Multicast forwarding is separated from the routing flag
30f4315 Wi-SUN discovery staten enter upxdate
083b84e Iotthd 4308 (ARMmbed#2473)
fcc33d5 Removed time increment from NVM time read function on interface up
9c8e3af fhss_tx_handle update
5491a6b Fixed UFSI update print function (ARMmbed#2470)
86f64c5 FHSS WS: Check if BC schedule is stopped before computing timeout delay (ARMmbed#2469)
a0b112a Corrected defects and coding style
2f4678a Corrected trace macro
5e96751 Distributed key storage NVM writes to longer time period
9b3891f FHSS WS: handle blocked interrupts (ARMmbed#2466)
a792e83 Added validation at MAC ack buffer handler
2a465b2 DNS configuration lifetime validation

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 715ae9a
artokin pushed a commit to artokin/mbed-os that referenced this issue Nov 18, 2020
…..715ae9a

715ae9a Merge remote-tracking branch 'origin/release_internal' into release_external
42c9807 Nanostak trace level configuration (ARMmbed#2489)
6f52171 Bug fix: socket reference count made 16-bit (ARMmbed#2490)
f51669a Bug fix: Do not print UFSI drift when fixed channel is used (ARMmbed#2488)
18fa048 RPL DAO timeout update:
660e178 Clear debug traces.
cbac0bb DIO init send block for node
fed5d1c Created different MPL configuration based on network size
7ad7e81 Wi-SUN recovery and BR BSI update:
d207f4d Merge branch 'release_internal' into release_external
d166c89 MPL: buffered max limit increased to 8k (ARMmbed#2482)
0f6666a Fixed Unit test's
1ff9b1d LLC drop a packet if FHSS shedule is not configured.
7cecc28 Fixed missing asynch trigle setup stop at if down process
7a8b2bf Wi-SUN fhss API default value setting fixes
164a370 Fixed coverity issues from management API
8b5b433 Corrected out of bounds access coverity warning (ARMmbed#2475)
4ffe6a1 Multicast forwarding is separated from the routing flag
30f4315 Wi-SUN discovery staten enter upxdate
083b84e Iotthd 4308 (ARMmbed#2473)
fcc33d5 Removed time increment from NVM time read function on interface up
9c8e3af fhss_tx_handle update
5491a6b Fixed UFSI update print function (ARMmbed#2470)
86f64c5 FHSS WS: Check if BC schedule is stopped before computing timeout delay (ARMmbed#2469)
a0b112a Corrected defects and coding style
2f4678a Corrected trace macro
5e96751 Distributed key storage NVM writes to longer time period
9b3891f FHSS WS: handle blocked interrupts (ARMmbed#2466)
a792e83 Added validation at MAC ack buffer handler
2a465b2 DNS configuration lifetime validation

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 715ae9a
artokin pushed a commit to artokin/mbed-os that referenced this issue Jan 19, 2021
…..3183d87

3183d87 Merge branch 'release_internal' into release_external
9e27a77 Disabled BR IID verify from DODAG ID
33ac791 Merge pull request ARMmbed#2548 from PelionIoT/sync_with_mbed_os
6f8b282 compile out trace when not available
825373d Add SPDX license identifier to Arm files
3ec3bc6 fixed warnings: static method defined but not used
ee34352 Check if RX channel needs to be updated when RX slot detected (ARMmbed#2540)
d59dc5d Fix doxygen 1.8.17 warnings (ARMmbed#2546)
1e0beb3 Update unit tests to support Ubuntu 2020_04 LTS (ARMmbed#2545)
b9b2ffd Fixed FHSS get retry period (ARMmbed#2543)
a0bf6ae Check if RX channel needs to be updated after broadcast received (ARMmbed#2539)
fde325e Wi-SUN Neighbour ARO registration failure handling update:
1e1f9c6 RPL dio Handler update:
0421502 Asynch message advertiment enable added to DAO done when disabled.
0374f74 Corrected memory leak on key storage allocation on low memory situation
23c2f7e Disable ASYNCH messages at enter Local repair state.
c1df6b0 Added Poison_count check for First DIO time blocker.
944f934 Added channel mask size to FHSS configuration (ARMmbed#2536)
20e79e0 RPL Local repair disable clear advertised_dodag_membership_since_last_repair state
8a46380 Fix doxygen comments (ARMmbed#2534)
fe06236 MAC ACK RX guarantee update
2388a80 MAC layer send ack allways when it requirement's
29b387b RPL dao dynamic timeout
00bbd02 Don't allow TX slot length go below allowed minimum (ARMmbed#2528)
8333faa Out of memory improvement to remove packets from routing
0a12aeb Support channel plan IDs 1, 2 and 5 with NA and BZ bands (ARMmbed#2526)
ee4333d Wi-SUN Timing configuration is selected based on network size and data rate
a5b2a26 WS: API to set PHY mode and Channel plan IDs as defined by FAN 1.1 (ARMmbed#2520)
b86a044 Update nanostack v12.7.0 changelog (ARMmbed#2525)
35b95da Remove unnecessary files from release
0717432 Merge remote-tracking branch 'origin/release_internal' into release_external
f68126b Adaptation layer MCPS confirmation handle update
e483a07 Added OFDM configurations and FEC in RF config structure (ARMmbed#2513)
b88abfa BUG fix: Fixed broken Brodcast MAC overflow handling
9cad478 Random early detection congestion API update
00aed73 Modified the Wi-SUN stack Latency estimates a bit slower
6b83d82 Remove periodic PAN version increase from Wi-SUN border router
ef670e2 Integrated ReD congestion packet drop to Wi-SUN bootstrap interface.
b956d9e Revert "Improved transmission in high traffic (ARMmbed#2511)" (ARMmbed#2512)
01749c2 Improved transmission in high traffic (ARMmbed#2511)
3158e96 Adaption layer queue trace update
5a32f4a Update changelog, random_early_detection_congestion_check nameupdate and minor comment fix.
b818f12 Extented network status for support dropped tx congestion packet.
11c0763 Added new service Random early detection
f2c358d Optimized medium NWK MPL parameters to 40 second multicast interval (ARMmbed#2508)
c013bc7 Added traces to EAPOL TX failure
c29ee94 Changed TLS return value to int32_t
501a2c8 Added trace for mbed TLS errors
9d7cd22 Updated change log
1290225 Corrected radius message memory allocation
7b1c596 Removed trace print's
efb8393 Adaptation layer MCPS confirmation handle update
ac1025e Bug Fix: Accept only next possible BSI for detect BR reboot and drop unkown's.
58f0e56 Updated change log
102e525 Nanostack now indicates connection down on RPL local repair start
395791d FHSS WS: Do not allow broadcast TX on unicast channel (ARMmbed#2501)
72f8ecb Updated changelog.md
2376208 Activated higher priority by traffic class CS6 for NS/NA and RPL, EAPOL/ DHCP Relay messages.
afbe906 Adaptation layer update
13fb2bf Update CHANGELOG.md
af81c48 DIO init TX filter update
13a872c Fix typos in github template (ARMmbed#2498)
1af20e1 Initial version of CHANGELOG (ARMmbed#2497)
d9874ed Feature update: Improved MAC TX queue purge
6926442 Wi-SUN Aro registration temporary address registation bug fix.
d3170ed Removed generic event and wrong trace info.
0db3486 Removed trace from place which is normal and not needed
a080f18 Added debug tarce for dropped unsecured and MPL packets.
51cd564 Wi-SUN NS probe update:
579f756 Adaptation layer: Do not push CCA failed packet back to MAC (Wi-SUN) (ARMmbed#2487)
715ae9a Merge remote-tracking branch 'origin/release_internal' into release_external
42c9807 Nanostak trace level configuration (ARMmbed#2489)
6f52171 Bug fix: socket reference count made 16-bit (ARMmbed#2490)
f51669a Bug fix: Do not print UFSI drift when fixed channel is used (ARMmbed#2488)
18fa048 RPL DAO timeout update:
660e178 Clear debug traces.
cbac0bb DIO init send block for node
fed5d1c Created different MPL configuration based on network size
7ad7e81 Wi-SUN recovery and BR BSI update:
d207f4d Merge branch 'release_internal' into release_external
d166c89 MPL: buffered max limit increased to 8k (ARMmbed#2482)
0f6666a Fixed Unit test's
1ff9b1d LLC drop a packet if FHSS shedule is not configured.
7cecc28 Fixed missing asynch trigle setup stop at if down process
7a8b2bf Wi-SUN fhss API default value setting fixes
164a370 Fixed coverity issues from management API
8b5b433 Corrected out of bounds access coverity warning (ARMmbed#2475)
4ffe6a1 Multicast forwarding is separated from the routing flag
30f4315 Wi-SUN discovery staten enter upxdate
083b84e Iotthd 4308 (ARMmbed#2473)
fcc33d5 Removed time increment from NVM time read function on interface up
9c8e3af fhss_tx_handle update
5491a6b Fixed UFSI update print function (ARMmbed#2470)
86f64c5 FHSS WS: Check if BC schedule is stopped before computing timeout delay (ARMmbed#2469)
a0b112a Corrected defects and coding style
2f4678a Corrected trace macro
5e96751 Distributed key storage NVM writes to longer time period
9b3891f FHSS WS: handle blocked interrupts (ARMmbed#2466)
a792e83 Added validation at MAC ack buffer handler
2a465b2 DNS configuration lifetime validation

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 3183d87
artokin pushed a commit to artokin/mbed-os that referenced this issue Jan 21, 2021
…..3183d87

3183d87 Merge branch 'release_internal' into release_external
9e27a77 Disabled BR IID verify from DODAG ID
33ac791 Merge pull request ARMmbed#2548 from PelionIoT/sync_with_mbed_os
6f8b282 compile out trace when not available
825373d Add SPDX license identifier to Arm files
3ec3bc6 fixed warnings: static method defined but not used
ee34352 Check if RX channel needs to be updated when RX slot detected (ARMmbed#2540)
d59dc5d Fix doxygen 1.8.17 warnings (ARMmbed#2546)
1e0beb3 Update unit tests to support Ubuntu 2020_04 LTS (ARMmbed#2545)
b9b2ffd Fixed FHSS get retry period (ARMmbed#2543)
a0bf6ae Check if RX channel needs to be updated after broadcast received (ARMmbed#2539)
fde325e Wi-SUN Neighbour ARO registration failure handling update:
1e1f9c6 RPL dio Handler update:
0421502 Asynch message advertiment enable added to DAO done when disabled.
0374f74 Corrected memory leak on key storage allocation on low memory situation
23c2f7e Disable ASYNCH messages at enter Local repair state.
c1df6b0 Added Poison_count check for First DIO time blocker.
944f934 Added channel mask size to FHSS configuration (ARMmbed#2536)
20e79e0 RPL Local repair disable clear advertised_dodag_membership_since_last_repair state
8a46380 Fix doxygen comments (ARMmbed#2534)
fe06236 MAC ACK RX guarantee update
2388a80 MAC layer send ack allways when it requirement's
29b387b RPL dao dynamic timeout
00bbd02 Don't allow TX slot length go below allowed minimum (ARMmbed#2528)
8333faa Out of memory improvement to remove packets from routing
0a12aeb Support channel plan IDs 1, 2 and 5 with NA and BZ bands (ARMmbed#2526)
ee4333d Wi-SUN Timing configuration is selected based on network size and data rate
a5b2a26 WS: API to set PHY mode and Channel plan IDs as defined by FAN 1.1 (ARMmbed#2520)
b86a044 Update nanostack v12.7.0 changelog (ARMmbed#2525)
35b95da Remove unnecessary files from release
0717432 Merge remote-tracking branch 'origin/release_internal' into release_external
f68126b Adaptation layer MCPS confirmation handle update
e483a07 Added OFDM configurations and FEC in RF config structure (ARMmbed#2513)
b88abfa BUG fix: Fixed broken Brodcast MAC overflow handling
9cad478 Random early detection congestion API update
00aed73 Modified the Wi-SUN stack Latency estimates a bit slower
6b83d82 Remove periodic PAN version increase from Wi-SUN border router
ef670e2 Integrated ReD congestion packet drop to Wi-SUN bootstrap interface.
b956d9e Revert "Improved transmission in high traffic (ARMmbed#2511)" (ARMmbed#2512)
01749c2 Improved transmission in high traffic (ARMmbed#2511)
3158e96 Adaption layer queue trace update
5a32f4a Update changelog, random_early_detection_congestion_check nameupdate and minor comment fix.
b818f12 Extented network status for support dropped tx congestion packet.
11c0763 Added new service Random early detection
f2c358d Optimized medium NWK MPL parameters to 40 second multicast interval (ARMmbed#2508)
c013bc7 Added traces to EAPOL TX failure
c29ee94 Changed TLS return value to int32_t
501a2c8 Added trace for mbed TLS errors
9d7cd22 Updated change log
1290225 Corrected radius message memory allocation
7b1c596 Removed trace print's
efb8393 Adaptation layer MCPS confirmation handle update
ac1025e Bug Fix: Accept only next possible BSI for detect BR reboot and drop unkown's.
58f0e56 Updated change log
102e525 Nanostack now indicates connection down on RPL local repair start
395791d FHSS WS: Do not allow broadcast TX on unicast channel (ARMmbed#2501)
72f8ecb Updated changelog.md
2376208 Activated higher priority by traffic class CS6 for NS/NA and RPL, EAPOL/ DHCP Relay messages.
afbe906 Adaptation layer update
13fb2bf Update CHANGELOG.md
af81c48 DIO init TX filter update
13a872c Fix typos in github template (ARMmbed#2498)
1af20e1 Initial version of CHANGELOG (ARMmbed#2497)
d9874ed Feature update: Improved MAC TX queue purge
6926442 Wi-SUN Aro registration temporary address registation bug fix.
d3170ed Removed generic event and wrong trace info.
0db3486 Removed trace from place which is normal and not needed
a080f18 Added debug tarce for dropped unsecured and MPL packets.
51cd564 Wi-SUN NS probe update:
579f756 Adaptation layer: Do not push CCA failed packet back to MAC (Wi-SUN) (ARMmbed#2487)
715ae9a Merge remote-tracking branch 'origin/release_internal' into release_external
42c9807 Nanostak trace level configuration (ARMmbed#2489)
6f52171 Bug fix: socket reference count made 16-bit (ARMmbed#2490)
f51669a Bug fix: Do not print UFSI drift when fixed channel is used (ARMmbed#2488)
18fa048 RPL DAO timeout update:
660e178 Clear debug traces.
cbac0bb DIO init send block for node
fed5d1c Created different MPL configuration based on network size
7ad7e81 Wi-SUN recovery and BR BSI update:
d207f4d Merge branch 'release_internal' into release_external
d166c89 MPL: buffered max limit increased to 8k (ARMmbed#2482)
0f6666a Fixed Unit test's
1ff9b1d LLC drop a packet if FHSS shedule is not configured.
7cecc28 Fixed missing asynch trigle setup stop at if down process
7a8b2bf Wi-SUN fhss API default value setting fixes
164a370 Fixed coverity issues from management API
8b5b433 Corrected out of bounds access coverity warning (ARMmbed#2475)
4ffe6a1 Multicast forwarding is separated from the routing flag
30f4315 Wi-SUN discovery staten enter upxdate
083b84e Iotthd 4308 (ARMmbed#2473)
fcc33d5 Removed time increment from NVM time read function on interface up
9c8e3af fhss_tx_handle update
5491a6b Fixed UFSI update print function (ARMmbed#2470)
86f64c5 FHSS WS: Check if BC schedule is stopped before computing timeout delay (ARMmbed#2469)
a0b112a Corrected defects and coding style
2f4678a Corrected trace macro
5e96751 Distributed key storage NVM writes to longer time period
9b3891f FHSS WS: handle blocked interrupts (ARMmbed#2466)
a792e83 Added validation at MAC ack buffer handler
2a465b2 DNS configuration lifetime validation

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 3183d87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants