‎2017-07-10 08:26 AM
Hello.
I want to connect an electronic micrometer to the microcontroller stm32f103�?8t6. The electronic micrometer has 2 outputs (date and clk). Judging by the readings of the logical analyzer, this is similar to the SPI protocol.In the cube I connected SPI1 (Receive Only Slave, Hardvare NSS-disable) through DMA (DMA in normal mode).In the program, sw4stm32 indicated the function of receiving spi through DMA (HAL_SPI_Receive_DMA (& hspi1, (uint8_t *) pBuffer, 3)).The reception of bytes occurs (every 100ms), but the buffer array constantly increases with the arrival of each packet and is not overwritten.How to overwrite an array of DMA with the reception of each parcel, clearing the previous value?‎2017-07-10 11:18 AM
Possibly circular mode might help. Or just re-issue the HAL_SPI_Receive_DMA() using the base address after each transfer.
‎2017-07-10 02:26 PM
Circular mode does not help
________________ Attachments : my_prim.txt.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyEA&d=%2Fa%2F0X0000000b9h%2Ff9He86xeP6GXK..eazhegu._OFeJLPUOO8t_wgqibRY&asPdf=false