Skip to main content
DKari.1
Associate
July 30, 2020
Question

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.

  • July 30, 2020
  • 2 replies
  • 979 views

 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.

    This topic has been closed for replies.

    2 replies

    S.Ma
    Principal
    July 30, 2020

    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
    DKari.1Author
    Associate
    July 30, 2020

    Thanks for your reply

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