cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f103ZCT6 communication with an ADC IC (ad7730) through SPI works fine in the debug mode but when I disconnect it from stlink and run the board normally, I receive random and wrong data.

DKari.1
Associate II

 After inspection I realized that RCC_CFGR register is different when running in different modes (debug and normal). I fixed the issue by writing RCC -> CFGR = 0x1F040A. Now the register is the same but the problem still exists.

another strange fact is that I have 6 boards, which are exactly the same (they are pcb printed and have the same components and I programmed the microcontrollers with the same code). The communication on one of the boards is OK but the rest of 5 boards have problems

I appreciate any comments in advance.

2 REPLIES 2
S.Ma
Principal

When you talk about debug mode, you are not talking debugging using STLink connected to target MCU with SWD link.

You are reffering to Eclipse specific "debug" and "normal" project modes?

If this is so, you might have borderline critical timings which might show up with slightly different compile option or oscillator tolerances.

To confirm this, you could try to enhance the problem by reducing the core frequency or disabling compiler optimisations options, so that if there is a critical timing it will be easier to see it. Then find the fix.

DKari.1
Associate II

Thanks for your reply

Sorry! I meant "debugging using STLink connected to target MCU with SWD link"