This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf51822 evaluation kit image from camera to BLE

Hi Im electrical engineer student. I am working on nrf51822 evaluation kit and LinkSprite JPEG Color Camera UART Interface. I tried to control the camera to take picture, store in flash then from flash go straight to BLE. I get stuck at storing image to flash. The library in keil folder doesnt provide that much example. Is there anyone have a direction for me to continue this project? Thank you

Parents
  • You should not store the image in flash. You need a SD card, external RAM or ROM for that. It is a good option to use SD card. Read all data from camera on serial interrupt and write it in SD card. You can write on SD card as RAW bytes. SD card writes and reads 512 bytes at a time so you need to make 2 512 bytes buffers this is because when buffer 1 is full you need to start receiving data on buffer 2 mean while write the data in buffer 1 to SD card. I have tried this and this logic works. One thing more you can reduce the size of image by sending it ratio command that why image size will be small.

Reply
  • You should not store the image in flash. You need a SD card, external RAM or ROM for that. It is a good option to use SD card. Read all data from camera on serial interrupt and write it in SD card. You can write on SD card as RAW bytes. SD card writes and reads 512 bytes at a time so you need to make 2 512 bytes buffers this is because when buffer 1 is full you need to start receiving data on buffer 2 mean while write the data in buffer 1 to SD card. I have tried this and this logic works. One thing more you can reduce the size of image by sending it ratio command that why image size will be small.

Children
  • Right now! I try to get a demo, which mean just need an complete image after sending through ble. I approach with ble_app_uart and simple_uart main files. I have some ideas:

    -uint8_t simple_uart_get(void) // get data from RXD pin

    -bool simple_uart_get_with_timeout(int32_t timeout_ms, uint8_t * rx_data) //get data and delay

    -void simple_uart_put(uint8_t cr) // put data to TXD pin

    -void simple_uart_putstring(const uint8_t * str) //ble_app_uart call this function,not sure what it does

    -static void advertising_init(void) // setup first conditions for ble

    -void uart_data_handler(ble_nus_t * p_nus, uint8_t * data, uint16_t length) // put data to handler

    -static void advertising_start(void) // send to ble

    Other functions in those main.c, i dont really understand fully, or do i really need all of them? Let me know if i miss something or misunderstand something Best regard

Related