Help wanted with stm32cubeprog - Page 1
Forum section: electronics / general

author: artag
author_rank: Super Contributor
timestamp: January 25, 2022, 10:31:25 pm
content: I'm trying to bring up a new board with an STM32 module and communication is failing.It looks as though the core is connected (and therefore the SWDIO is OK) but RAM isn'tThis is the 'connect' operation in stm32cubeprog on a good device (actually, an almost bare module with just power and swdio connected)19:31:36 : ST-LINK SN : 53FF6506667849510629088719:31:36 : ST-LINK FW : V2J38S719:31:36 : Board : --19:31:36 : Voltage : 3.01V19:31:36 : SWD freq : 4000 KHz19:31:36 : Connect mode: Under Reset19:31:36 : Reset mode : Hardware reset19:31:36 : Device ID : 0x44719:31:36 : Revision ID : Rev Z19:31:36 : ST-LINK SN : 53FF6506667849510629088719:31:36 : ST-LINK FW : V2J38S719:31:36 : Board : --19:31:36 : Voltage : 3.19V19:31:36 : SWD freq : 4000 KHz19:31:36 : Connect mode: Under Reset19:31:36 : Reset mode : Hardware reset19:31:36 : Device ID : 0x44719:31:36 : Revision ID : Rev Z19:31:36 : Debug in Low Power mode is not supported for this device.19:31:36 : UPLOADING OPTION BYTES DATA ...19:31:36 : Bank : 0x0019:31:36 : Address : 0x4002201c19:31:36 : Size : 104 Bytes19:31:36 : Bank : 0x0119:31:36 : Address : 0x1ff8000019:31:36 : Size : 20 Bytes19:31:36 : UPLOADING ...19:31:36 : Size : 1024 Bytes19:31:36 : Address : 0x800000019:31:36 : Read progress:19:31:36 : Data read successfully19:31:36 : Time elapsed during the read operation is: 00:00:00.008And this is the same operation with a non-working board.It's not impossible that the module is damaged but probably more likely that something external is disabling the ram19:34:15 : ST-LINK SN : 53FF6506667849510629088719:34:15 : ST-LINK FW : V2J38S719:34:15 : Board : --19:34:15 : Voltage : 3.21V19:34:15 : SWD freq : 4000 KHz19:34:15 : Connect mode: Under Reset19:34:15 : Reset mode : Hardware reset19:34:15 : Device ID : 0x44719:34:15 : Revision ID : Rev Z19:34:15 : ST-LINK SN : 53FF6506667849510629088719:34:15 : ST-LINK FW : V2J38S719:34:15 : Board : --19:34:15 : Voltage : 3.22V19:34:15 : SWD freq : 4000 KHz19:34:15 : Connect mode: Under Reset19:34:15 : Reset mode : Hardware reset19:34:15 : Device ID : 0x44719:34:15 : Revision ID : Rev Z19:34:15 : Debug in Low Power mode is not supported for this device.19:34:15 : UPLOADING OPTION BYTES DATA ...19:34:15 : Bank : 0x0019:34:15 : Address : 0x4002201c19:34:15 : Size : 104 Bytes19:34:15 : Bank : 0x0119:34:15 : Address : 0x1ff8000019:34:15 : Size : 20 Bytes19:34:15 : UPLOADING ...19:34:15 : Size : 1024 Bytes19:34:15 : Address : 0x800000019:34:15 : Read progress:19:34:15 : Error: Data read failedAnybody got any ideas on what external errors might cause that failure ?

author: DavidAlfa
author_rank: Super Contributor
timestamp: January 25, 2022, 11:30:03 pm
content: Maybe some code protection is enabled? Have you tried a full erase?https://community.st.com/s/question/0D53W000007W4a8/why-do-i-get-the-error-error-data-read-failedHonestly I like more ST-Link utility than CubeProgrammer, give it a try!

author: artag
author_rank: Super Contributor
timestamp: January 25, 2022, 11:46:59 pm
content: no, it's a new part. I can't erase it because this process needs to complete before the debugger/programmer can do further operations.I think it does have some preprogramming but nothing mysterious. The working part (which is wired up dead-bug style with power and stdio) differs only in that it's already been programmed with some test code using this method. And this is the basic 'connect' operation - not trying to read the actual code.I think that transfer is the programmer attempting to write some interface code into ram so it can connect, but it fails to read it back.I will try stlink but I think there was some reason why it wasn't viable.

author: artag
author_rank: Super Contributor
timestamp: February 02, 2022, 11:23:37 pm
content: David was correct : read out protection was enabled. This prevents the read of flash at 0x80000000 normally performed by the 'connect' operationIn order to fix this, choose option bytes->read out protection : set AA and Apply.In order to do this, the programmer will connect and show connected, but does not do the read of 0x80000000.Full erase doers not change this option byte,