You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Fill the buffer with values unused by the ADC hardware. We can use this to perform demuxing // of a live DMA buffer as it is being filled. :)// We choose 0x88 as a 16 bit signed 0x8888 is an invalid 14 bit sample (either +ve or -ve)
b.fill(0x88);
This has been reported by the team working on the factory test programme, and I've struggled a bit to recreate it in a simple/short programme, but managed to make it easier to trigger when the compiler optimisation level is set to -O0 (or whatever is the default in gcc, as the CMAKE Debug build type doesn't set that flag).
The full example can be found here, as it needs changes to build.py to change the build type:
Changes the CMAKE build type to Debug, so that optimisations are turned off
There is a new DataSink connected to the microphone raw output
This DataSink simply checks for value -30584 (0x8888) in its pullRequest() and if finds it, it dumps the upstream buffer to serial
For the issue to trigger, apart from creating an instance of this DataSink, we also have to set the virtual pin PWM output AND execute the getAnalogValue() from a pin.
On a typical run the serial output continuously prints buffers like this:
And the ADC buffer is pre-filled with value 0x88 in codal-nrf52/source/NRF52ADC.cpp#L436-L446:
This has been reported by the team working on the factory test programme, and I've struggled a bit to recreate it in a simple/short programme, but managed to make it easier to trigger when the compiler optimisation level is set to
-O0
(or whatever is the default in gcc, as the CMAKEDebug
build type doesn't set that flag).The full example can be found here, as it needs changes to build.py to change the build type:
The example contains the following:
Debug
, so that optimisations are turned off-30584
(0x8888
) in itspullRequest()
and if finds it, it dumps the upstream buffer to serialgetAnalogValue()
from a pin.On a typical run the serial output continuously prints buffers like this:
The text was updated successfully, but these errors were encountered: