Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB Issues after bad code write #50

Closed
vaibhav-kapoor opened this issue Jan 24, 2012 · 2 comments
Closed

USB Issues after bad code write #50

vaibhav-kapoor opened this issue Jan 24, 2012 · 2 comments

Comments

@vaibhav-kapoor
Copy link

Hi, just yesterday I had flashed some PWM code relating to the PD12-15 pins, and for some reason after that the board would not be recognized by the computer, both on Windows and Linux. If I held down the reset button the computer successfully recognizes the chip and I can upload code to it. Unfortunately the code doesn't do anything once uploaded and the behavior is the same. It registers as an unknown device in Windows.

Now someone on the forums mentioned that if pull the BOOT0 pin up to the supply that it can reupload the code. So it seems to work, but it doesn't now code get's maybe 90% uploaded but always results in error. I have also erased the chip using ST-Link utility. So the problem with detection is not gone away the only way to upload code

This is an example of the error I get:

[TheLegace@localhost discovery_demo]$ flash write STM32F4-Discovery_Demo.bin 0x8000000
2012-01-23T20:47:23 WARN src/stlink-usb.c: Couldn't find any ST-Link/V2 devices[TheLegace@localhost discovery_demo]$ flash write STM32F4-Discovery_Demo.bin 0x8000000
2012-01-23T20:47:24 INFO src/stlink-usb.c: -- exit_dfu_mode
2012-01-23T20:47:24 INFO src/stlink-common.c: Loading device parameters....
2012-01-23T20:47:24 INFO src/stlink-common.c: Device connected is: F4 device, id 0x413
2012-01-23T20:47:24 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
2012-01-23T20:47:24 INFO src/stlink-common.c: Attempting to write 31620 (0x7b84) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000
Flash page at addr: 0x08000000 erasedEraseFlash - Sector:0x1 Size:0x4000
Flash page at addr: 0x08004000 erased
2012-01-23T20:47:25 INFO src/stlink-common.c: Finished erasing 2 pages of 16384 (0x4000) bytes
Writing 4kB chunk 1 out of 7
Writing 4kB chunk 2 out of 7
Writing 4kB chunk 3 out of 7
Writing 4kB chunk 4 out of 7
Writing 4kB chunk 5 out of 7
Writing 4kB chunk 6 out of 7
Writing 4kB chunk 7 out of 7
Writing 4kB chunk 8 out of 7
libusb_handle_events() | has_error
[!] send_recv
libusb_handle_events() | has_error
[!] send_only

I am going to see if the windows flasher works properly or not.
Thanks.

@UweBonnes
Copy link
Contributor

Probably this is the STLINK bug with big (>0x1800) Bytes. The USB machines just stalls. Recent git should have this bug fixed by not issuing big transfers. Please retest!

@UweBonnes
Copy link
Contributor

My commit from February 2 "Verify F2 and F4 by using a decent block size" should fix that issue and "works for me". As the issue was opened earlier and the poster didn't react, I propose to vlose that issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants