sparkfun / SparkFun_Edge_BSP

BSP and examples to integrate the SparkFun TensorFlow board with the AmbiqSuite
20 stars 8 forks source link

Apollo3 Blue AmbiqSuite Release 2.1.0 Compatibility #4

Open karma0 opened 5 years ago

karma0 commented 5 years ago

The only major change that I'm seeing is that the definition of am_hal_adc_samples_read has changed.

extern uint32_t am_hal_adc_samples_read(void *pHandle, bool bFullSample,
                                       uint32_t *pui32InSampleBuffer,
                                       uint32_t *pui32InOutNumberSamples,
                                       am_hal_adc_sample_t *pui32OutBuffer);

am_hal_adc_samples_read used to be:

extern uint32_t am_hal_adc_samples_read(void *pHandle,
                                       uint32_t *pui32InSampleBuffer,    
                                       uint32_t *pui32InOutNumberSamples,
                                       am_hal_adc_sample_t *pui32OutBuffer);

According to the documentation:

bFullSample          - true to get a full sample including the fractional part.

Only a true or false needs to be passed. Seems like a minor change, and setting this value in the call to am_hal_adc_samples_read in /example1_edge_test/src/tf_adc/tf_adc.c seems to allow everything to build successfully when I try.

karma0 commented 5 years ago

Issue #3 is about the firmware loader not getting a response to the Hello request, there aren't any compilation issues. Issue #4 (this issue) is about updating the underlying SDK from v2.0.0 to v2.1.0.

oclyke commented 5 years ago

Cool, that's good to know. Have you searched for other differences between the two releases in general or just for the examples that we've included?

karma0 commented 5 years ago

I looked at the diff and there are a lot of adjustments to things that I don't understand. The changelog mentioned some things that may or may not be relevant. Oddly, the changelog did not mention the change to am_hal_adc_samples_read() so I don't trust it as a comprehensive reference.

It's probably important to know that this is the only change likely needed to make example1 work and that I have not looked at any of the other examples.

If I can get code to upload to the device, I will confirm beyond compilation and see if we can get it working for the rest of the examples. Then I could look into submitting a PR. (fingers crossed) If someone actually has flashing working and wants to try it, go for it!