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

cdc_acm example doesn't work on nrf52840_pca10059 #14946

Closed
markrages opened this issue Mar 27, 2019 · 11 comments
Closed

cdc_acm example doesn't work on nrf52840_pca10059 #14946

markrages opened this issue Mar 27, 2019 · 11 comments
Assignees
Labels
area: MCUBoot area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug

Comments

@markrages
Copy link

Describe the bug
CDC_ACM example doesn't work in nrf52840_pca10059. The USB device doesn't appear.

To Reproduce
I build using the workaround in #14945:

  1. west build -d build/nRF52/mcuboot -s mcuboot/boot/zephyr -b nrf52840_pca10059 -- -DCONFIG_FLASH_LOAD_OFFSET=0x1000 -DCONFIG_FLASH_LOAD_SIZE=0xf000
  2. west build -d build/nRF52/cdc_acm -s zephyrproject/zephyr/samples/subsys/usb/cdc_acm -b nrf52840_pca10059 -- -DCONFIG_FLASH_LOAD_OFFSET=0x10000 -DCONFIG_FLASH_LOAD_SIZE=0x5E000
  3. west sign -d build/nRF52/cdc_acm/ -t imgtool -- --key mcuboot/root-rsa-2048.pem
  4. Load build/nRF52/mcuboot/zephyr/zephyr.hex and zephyr.signed.hex simultaneously with nRF Connect app.

Expected behavior
A device appears in lsusb output. A tty device appears as /dev/ttyACM*

Actual behavior
No device appears in lsusb. No USB messages appear in dmesg.

Impact
I am stuck in my development without a working serial port.

Environment

  • OS: Ubuntu 18.04
  • Toolchain: zephyr-sdk-0.10.0
  • Commit: c3cf543
@markrages markrages added the bug The issue is a bug, or the PR is fixing a bug label Mar 27, 2019
@carlescufi carlescufi added the area: USB Universal Serial Bus label Mar 27, 2019
@markrages
Copy link
Author

Here's backtrace:

#0  0x00017edc in cdc_acm_line_ctrl_get (dev=0x20003764 <__device_cdc_acm_0>, 
    ctrl=4, val=0x2000239c <_main_stack+980>)
    at /home/markrages/zephyr/zephyrproject/zephyr/subsys/usb/class/cdc_acm.c:878
#1  0x0001154c in z_impl_uart_line_ctrl_get (val=0x2000239c <_main_stack+980>, 
    ctrl=4, dev=0x20003764 <__device_cdc_acm_0>)
    at /home/markrages/zephyr/zephyrproject/zephyr/include/uart.h:1112
#2  uart_line_ctrl_get (ctrl=4, val=0x2000239c <_main_stack+980>, 
    dev=0x20003764 <__device_cdc_acm_0>)
    at zephyr/include/generated/syscalls/uart.h:41
#3  main ()
    at /home/markrages/zephyr/zephyrproject/zephyr/samples/subsys/usb/cdc_acm/src/main.c:89

@markrages
Copy link
Author

Waiting for DTR is like #13662. Except I am sure the device is plugged in to USB -- that's how I loaded the code.

@jfischer-no
Copy link
Collaborator

Except I am sure the device is plugged in to USB -- that's how I loaded the code.

micro USB connector labeled as "nRF USB" is also connected to the host?

@rljordan-zz rljordan-zz added the priority: low Low impact/importance bug label Mar 28, 2019
@markrages
Copy link
Author

@jfischer-phytec-iot the '59 is the dongle, see picture on this unrelated bug: NordicSemiconductor/pc-nrfconnect-programmer#116 (comment)

@markrages
Copy link
Author

markrages commented Mar 28, 2019

So, this worked once.

I did the git bisect dance, and learned two things:

  1. usb is not working with the nrf52840_pca10059 executables do not work without mcuboot #14945 workaround. Instead compile with west build -d $BUILDDIR -s $SOURCEDIR -b nrf52840_pca10059 -- -DCONFIG_FLASH_LOAD_OFFSET=0x1000 -DCONFIG_FLASH_LOAD_SIZE=0x1f000
  2. cdc_acm example works before 5977b3d, and is broken from then on.

@jfischer-no
Copy link
Collaborator

Tested with reel board and frdm-k64f, works fine.

@lemrey
Copy link
Collaborator

lemrey commented Mar 28, 2019

Hi @markrages, could you please check if #14978 fixes this issue. Thank you.

@markrages
Copy link
Author

@lemrey yes, #14978 fixes it.

@markrages
Copy link
Author

The #14945 workaround did not work for USB example, I assume because #14875

@carlescufi
Copy link
Member

@markrages is this one fixed too by #14875? If so, could you please close it? Thanks!

@markrages
Copy link
Author

Everything appears to work with #14978 and #14875 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: MCUBoot area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

7 participants