2015-07-16 10:07 AM
Hi. I'm using stm32f429i-discovery I am controlling RFM69HC module (device) over SPI and I could get communicating both of them. I'm checking device's ID, and some other controllable registers and there is no problem of these. I've created a device struct and creating some arrays dynamcally so first I needed more heap size then the default one (in the *.s file Heap_Size variable) and increased it to 400 (default is 200). Now I am facing an error that when I connecting the board with keil and run without any breakpoints, program has not set some registers in the device over spi (I'm checking written value with reading the same address on the device), and returning (-1) but when I put there a bp then go into the function and complete it step by step, it is not returning any error (which means returns 0) device is configuring correctly. I'm checking these return values and writing the results to the LCD on discovery board. When I stepping function returning 0, when in run it's returning -1. I'm thinking about memory alignment but I'm not sure.
2015-07-16 11:02 AM
> Now I am facing an error that when I connecting the board with keil and run without any
> breakpoints, program has not set some registers in the device Namely which registers? How do yo know they are not set? JW2015-07-16 11:07 AM
If you park a peripheral viewer over the SPI you will break it. Most specifically if it reads DR it will change the state of SR/RXNE
2015-07-16 11:46 AM
I'm sorry I edited the question to be more clear if you need I think I can write example code
2015-07-16 12:15 PM
I've solved the problem. Device is getting ready so slowly so in debug mode MCU is enough slow for that but in run mode MCU is doing check 100 times but device is still trying to get ready. The device datasheet has no info about that. When I increased it to 500 it's working now. Thanks again