This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52840 usb audio class example only works on debug

I'm using nrf52840 with nRF5_SDK_17.0.0_9d13099 and usbd_audio loopback example.

The example works fine with the given hex file 

but when i compile it myself, the signal seems to have variable type issue.

but in debugging everthings works fine 

I have suspect it's an issue with optimization which mess with the buffer or the signal input, but it seems that removing optimisation option has not resolved the problem.

Maybe someone could share with me their Makefile for the project?

  • Could you share details about the hardware you are using for test? E.g. the label on the nRF52840-DK and the chip markings on the nRF52840 IC?

  • nRF52840-Preview-DK

    on the chip:
    PCA10056
    V0.9.0
    2017.10

    683442918

  • the problem is that in debug mode it works just fine.. so i can't really debug it.

  • I think I have found the problem.

    You are using a preview kit of the nRF52840, these contain engineering samples before final silicon, and before the chip went to mass production. These chips have several USB issues. Please order a new nRF52840-DK. 

    I know this does not directly explain why precompiled works vs. your compiled, however these chips are not recommended for development in any case. So likely they are only marginally working here.

    Best regards,
    Kenneth

  • Thank you Kenneth.
    Consider it closed. 
    We will order another board.

Related