cancel
Showing results for 
Search instead for 
Did you mean: 

DCMI data storage order in stm32f407

armindavatgaran
Associate III
Posted on July 08, 2015 at 21:14

Hello

Suppose data is arrived from dcmi in following order:

1st byte : R[4:0]G[5:3]

2nd byte : G[2:0]B[4:0]

3rd byte : R[4:0]G[5:3]

4th byte : G[2:0]B[4:0]

.

.

.

And so on, how it will be saved in memory?

Thanks.

3 REPLIES 3
Posted on July 08, 2015 at 21:49

And so on, how it will be saved in memory?

Just like that if you're doing 8-bit transfers. Looks to be a small-endian 5-6-5 type representation. You should be able to load as a 16-bit word and mask/shift the colour values out.

The combinations should be rather small if it's some other format/order. Point the camera at different Red, Green and Blue sheets of card if that helps to separate the colour channels.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
armindavatgaran
Associate III
Posted on July 08, 2015 at 22:20

I didn't explain completely, according to picture below the 2nd received byte is stacked at first byte of DCMI FIFO, my question is whether it will be the actual placement of data in memory(assuming little endian) or it will be placed as it was received?   

Posted on July 08, 2015 at 22:46

Ok, but they still seem to be in order. If you believe the diagram the Red and Blue channels are swapped, but if you read the memory out 16-bits at a time the pixels will be in order.

I would take the Camera manual as the controlling document for the byte/bit ordering for what it's sending. The hardware's going to deliver the data in the order it's sent, there's no value to swizzling the bit/byte ordering at the DCMI/DMA level. The FIFO is there to provide elasticity where the inbound rate/size and outbound rate/size are not perfectly balanced.

Point the camera at a solid red image, it should be quite apparent what channel R is.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..