scanlime / esp8266-arm-swd Goto Github PK
View Code? Open in Web Editor NEWProof-of-concept ESP8266 web server and ARM Serial Wire Debug client
License: MIT License
Proof-of-concept ESP8266 web server and ARM Serial Wire Debug client
License: MIT License
Hi,
thank you very much for making this public. I have built a custom Teensy reference board and wrote about it in my blog (http://www.appfruits.com/2015/03/building-your-own-custom-teensy/). While I actually really love the Teensy I would like to build a board without the boot loader MCU.
What I want to build is an ESP8266 which is able to download a firmware for the K20 MCU and flash it with SWD. I found your code which looks like to actually do that, but I don't get it working.
I am not sure which init function (there are a few like startup, begin, init) I need to use to get the K20 in the correct state. When beginning flashing I receive error message that flash is not ready for mass erasing. When I add a few delays I sometimes get an AP polling error.
Any help would be appreciated.
Thanks,
Phillip
Hello,
first of all: Thank you for this project! It has helped me a lot on my first deepdive into the world of microcontrollers.
I am trying to flash an STM32 ARM microcontroller from an ESP32 and your ARMDebug Class has gotten me quite far.
I can connect, unlock the flash, mass erase and I can programm individual parts of the flash.
But when I try to write a whole 32KB of Firmware the flash process fails after a while and I have not found a way to recover from that.
I was hoping that maybe you could give me a hint what I should be looking for in the documentation or to debug the code, even though this is not about the MC you are using in your project.
This is the main loop that writes to the flash:
for (size_t i = 0; i < bufferSize; i +=4) {
waitbusy();
writePG1();
uint32_t data = *((uint32_t*)(buffer + i));
Serial.println(String(i) + " writing: 0x" + String(FLASH_OFFSET + i, HEX)+":0x"+String(data, HEX));
memStore(FLASH_OFFSET + i, data);
waitbusy();
uint32_t temp;
memLoad(FLASH_OFFSET + i, temp);
if(temp!=data){
handleFault();
Serial.println(String(i) + " verify failed. expected: 0x" + String(data, HEX) + " read: " + String(temp,HEX) + " retrying");
i-=4;
}
}
in the beginning the write and verify succeeds. After ~2000 operations I am occasionally getting parity errors:
PARITY ERROR during read (addr=0 APnDP=1 data=63000052)
ARMDebug: Error while waiting for memory port
those seem to be resolved by the retry mechanism.
But shortly after (~2500 operations in) I am endlessly getting errors like:
PROTOCOL ERROR response during read (ack=3 addr=c APnDP=0)
ARMDebug: Error while waiting for memory port
Retrying obviously does not solve the issue the STM has at that point.
Do you have any idea how I can find out whats blocking the flash operations at this point and how it can be resolved?
Best regards
Ier
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.