I have the example project for the ADXL345 Accel that is on the Intel FTP site. I copied this and simply disabled the reads of the i2c0 RX Buffer. I set up the watermark level of the dma to 30 entries, I have 36 entries in the RX Buffer, but for some reason it won't transfer the data. I keep getting a status = -1 right at the API call alt_dma_periph_to_memory.
I've replaced the data destination to an internal buffer then to the SDRAM, still won't work. I've rechecked all the settings made sure everything is out of reset, configured properly, the i2c works as intended, the program is correctly setup in on chip memory, data buffers fill up, and I cannot find out why it won't transfer. I know I can do this in Linux no problem, but this is a learning project for myself.
Can anyone shed some light on the problem?
I was able to solve the problem. There is an error in the HWLibs , I single stepped the code and right at the api call alt_dma_channel_exec(channel, program) which is on line 5728 of dma.c it stopped at this line
if (!(g_dmaState.channel_info[channel].flag & ALT_DMA_CHANNEL_INFO_FLAG_ALLOCED))
Apparently there is a flag to validate the channel is allocated. I commented this line out and it successfully ran. Also not mentioned in my code is the fact the transmit signal has to be activated and watermark level set correctly.
Has anyone else had problems with the included hwlibs having errors? Why is there no errata sheet to correct these errors or updates to fix them?
Thanks for updating the solution here for the benefit of the community.
Will take a note of this error and will communicate it to the respective contacts to validate and rectify it.
Thanks and Regards