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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 06:08 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 06:16 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-30 06:36 AM
Thanks for your reply
Sorry! I meant "debugging using STLink connected to target MCU with SWD link"