adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
445 stars 401 forks source link

SPI Failure #135

Closed embenix closed 4 years ago

embenix commented 4 years ago

Hardware Setup

Problem Description The SPI communication doesn't work when the board is powered up with battery alone. Otherwise works fine when USB is plugged in. The problem is mainly related to VBUS. When I supply the VBUS with external 5V everything seems to work fine.

To Reproduce Simply program the board with any SPI example and power up the board with battery or any 3.3v source alone. It won't communicate.

Expected behavior In my case, I have connected a fingerprint sensor FPC BM-Lite which is communicating through SPI. The sensor gets initialized well when USB is plugged as shown below: IMG_20200529_004549 But throws back communication error when USB is not plugged!! IMG_20200529_004617

Data from logic analyzer When SPI is working fine I can easily see the communication 2020-05-29

hathach commented 4 years ago

are you SURE this is the bootloader's bug !!!??? Bootloader don't even enable SPI peripheral at all !!!!

embenix commented 4 years ago

are you SURE this is the bootloader's bug !!!??? Bootloader don't even enable SPI peripheral at all !!!!

I am not 100% sure if this is directly related to bootloader but something wrong is happening in the very beginning. If I power up the board with USB then everything works fine otherwise SPI doesn't work at all.

dhalbert commented 4 years ago

Maybe try this with a vanilla Arduino SPI program as well, as opposed to platformIO.

embenix commented 4 years ago

I successfully tested the SPI with TFT module from Adafruit and it seems to work fine. So I found a work around. I am initializing SPI TFT first and then initializing the fingerprint sensor. Problem solved. ;) IMG_20200529_233830

Thanks for your responses. 👍