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

Doesn't Work, "Unexpected data" error #21

Closed
frak0d opened this issue Mar 9, 2024 · 4 comments
Closed

Doesn't Work, "Unexpected data" error #21

frak0d opened this issue Mar 9, 2024 · 4 comments

Comments

@frak0d
Copy link

frak0d commented Mar 9, 2024

I have the same boards as shown in README, a Nodemcu with ch340 chip and a STM8S103F3P6. I have double checked the wiring. And yes i have the pullup resistor in right place.

I am now trying to flash a blink.ihx that I got from SDCC compiler.

But it keeps failing with Unexpected data: xx (replace xx with random hex values)

I have tried flashing with both stm8flash and python/flash.py, both giving the same error.
I also tried setting 115200 baud rate in src/user/user_main.c and in libespstlink.c, still same error in both flashing tools.
I also tried with and without pullup resistor, same error.
I also tried reducing delay in read_byte as suggested in #18 , still same error.

am i doing something wrong ?

@rumpeltux
Copy link
Owner

It could also be that your power supply is not strong enough, what’s your host system?
And you do definitely need the pullup resistor.

@frak0d
Copy link
Author

frak0d commented Mar 13, 2024

Host is a Asus Tuf A15 laptop.

My powering setup is like:
Laptop USB Port --> NodeMCU LDO --> stm8s103f3p6

NodeMCU's LDO seems to be providing 1A of constant current (and 1.5A peaks) according to my multimeter, so i doubt its a power supply issue.

the onboard micro usb of stm8 was not connected to anything.


Edit: It turns out my stm8 board is a badly designed clone, and the GND among the swim headers wasn't connected to anything. i fixed that by connecting it to the other GND pin as recommended in sduino docs. the power led now lights up while connected to nodemcu.

However it still fails to program with same error.

@rumpeltux
Copy link
Owner

Sorry, to further debug I’d probably attach this to a scope to see what’s going. Without that nothing I can do. If you figure it out, let me know or send a patch if it’s a software issue.

@rumpeltux rumpeltux closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
@frak0d
Copy link
Author

frak0d commented Apr 3, 2024

I got myself a STLINK-V2 Clone, but even with that stlink and stm8flash are unable to connect to SWD.

Only thing that worked for me was ST Visual Programmer (STVP) on windows.
(weirdly enough, it also fails to connect on first 2 tries, but then works fine after that)

Compiling in Arduino IDE and then flashing in STVP is inconvenient, but atleast it works.

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

No branches or pull requests

2 participants