arduino_stm32 in reverse

What could be included in further releases, or for the forum.
Post Reply
zmemw16
Posts: 1303
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

arduino_stm32 in reverse

Post by zmemw16 » Sun Mar 27, 2016 2:00 pm

scenario - breadboard with a maple mini and an oled display, conveniently displaying a time in msec and a width
as in Time = nnnnn and W = 128

searching my various sketchbook folder and backups i can't seem to locate the source.

so i'm wondering if there's likely to be any help in the downloaded code?

consequently i'm also wondering as we have oodles of memory flashing about if writing something about the sources into it would be useful?
as an option append a zip of the directory and a list of the libraries, maybe the date/time of the arduino_stm32 used?

am i the only one who was about to change the battery in his clock? :D

stephen

User avatar
mrburnette
Posts: 1794
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: arduino_stm32 in reverse

Post by mrburnette » Sun Mar 27, 2016 6:41 pm

searching my various sketchbook folder and backups i can't seem to locate the source.
I usually search on some string used in the display that may give a clue ... perhaps "width" or "width:" or even a version number if you have used that in the boot-up messages.

You can always put strings into PROGMEM if you want
const char* stuff[] = {"This is version ... the purpose of which is to ...};

Getting stuff out of an AVR is easy, just use avrdude from the command line; I have some examples.

But I have never extracted any of the binary from the STM32F103... ummm, sounds like a rainy day project.


Ray

zmemw16
Posts: 1303
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: arduino_stm32 in reverse

Post by zmemw16 » Sun Mar 27, 2016 8:04 pm

PROGMEM occurred to me as well, right after the submit button got hit :D

i suppose i'll be sprinkling them in the init or begin routines of the libraries i used, maybe just in the 'lib'.h file
if i used an #ifdef IDENT around the PROGMEM in each library and defined IDENT in the main code?
by default as it's undefined then nothing changes.

i see a shell script in my near future. ... ...

stephen

User avatar
mrburnette
Posts: 1794
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: arduino_stm32 in reverse

Post by mrburnette » Mon Mar 28, 2016 12:37 pm

zmemw16 wrote: <...>
i suppose i'll be sprinkling them in the init or begin routines of the libraries i used, <...>
I am certainly NOT an authority on developer workstation organization! :o
However, under ~Arduino/MySketches I have the subdirectory structure by
/hardware - examples:Uno, Mega2560, ProMicro, tiny85, STM32, ESP8266, etc. Under MySketches/ESP8266
I have the subdirectory structure more specific, for example ILI9341, BMP180, DS18B10, PCD8544, SSD1306, etc.
Or, If I publish a project, I have that code and libraries in the project name, example: MagicMorse
So, some real life examples:

Code: Select all

Sketches\MapleMini\Graphic_Displays\ILI9341\ILI9341_fastgraphics
Sketches\MapleMini\Graphic_Displays\ILI9341\ILI9341_fastgraphics2
Sketches\MapleMini\Graphic_Displays\ILI9341\ILI9341_Harichord
Sketches\MapleMini\Graphic_Displays\ILI9341\ILI9341_hwScroll
Sketches\MapleMini\Graphic_Displays\SSD1306\Conways_OLED

Sketches\ProMicro\GLCD_OLED\ILI9163\TFT_ILI9163C-master
Sketches\ProMicro\GLCD_OLED\ILI9163\Version 3_5 (current)\examples

Sketches\Tiny85\ColdHeartedOrb
Sketches\Tiny85\Tiny85_MagicMorse_Debug

Sketches\UNO\HIDserialUSnoobie\USB_HID_AnalogX6_D8
Sketches\UNO\I2C\MCP342x_AD_I2C_Explore
Sketches\UNO\I2C\_24C32_eePROM_WriteReadBytes

<...>
And even now, I still often find it difficult to find that one piece of code I want! I think it comes with the hobby. The trick is to use as many key words in the filename as possible... be descriptive.

Another trick that I do often, is once I complete a project, I go back and gut the project and save just enough code that I can use it in the future as a known working template for a new program. This will literally save you hours and also provide some structure as you start a new project. I never go back and rework a prior project, I make my changes and save it with a version number:

Code: Select all

Sketches\UNO\Morse\Magic_Morse_V8a
However, I do take a rainy afternoon from time to time and go back into the directory structure and ZIP older versions and delete everything else... so, in the case of Sketches\UNO\Morse\Magic_Morse_V8a, I would have a ZIP in the parent directory (Morse) named Magic_Morse_V8 and the subdirectory would be empty. That way, I can quickly expand if I need the files.

The last thing that I do which may be "weird' is that I create a Tab in the IDE titled "Notes-Credits.h" and the entire tab is /* ... */ commented, so essentially a nothing tab. In this tab, I will put my character graphics, my notes, URL references, etc. I still use the // comments inline with the code, but multi-line comments and references and even test results I drop into the Notes.h tab. Very handy.


Ray

zmemw16
Posts: 1303
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: arduino_stm32 in reverse

Post by zmemw16 » Mon Mar 28, 2016 3:03 pm

i've tried with the #ifdef IDENT; no go
i tried declaring the progmem statements in the init/begin code, seems only strings in the main stick, that's strange. i'll try it again to confirm that.

i have however managed using dfu-util to read back 2 areas of the target, 108k and 120k

Code: Select all

stephen@i7:~/sketchbook/hardware/Arduino_STM32/tools/linux/dfu-util$ dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [1eaf:0003] ver=0201, devnum=24, cfg=1, intf=0, alt=2, name="STM32duino bootloader v1.0  Upload to Flash 0x8002000", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=24, cfg=1, intf=0, alt=1, name="STM32duino bootloader v1.0  Upload to Flash 0x8005000", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=24, cfg=1, intf=0, alt=0, name="STM32duino bootloader v1.0  ERROR. Upload to RAM not supported.", serial="LLM 003"
stephen@i7:~/sketchbook/hardware/Arduino_STM32/tools/linux/dfu-util$ dfu-util -R -a 1 -U xyz
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from DFU device to PC
Upload  [======================== ]  99%         1024 bytesdfu-util: Error during upload
Upload  [=========================] 100%       110592 bytes
Upload done.
in xyz

Code: Select all

Hello World!
 Want pi?
 Print HEX!
Sketch has been
running for: 
 seconds.
Hello! ST7735 TFT Test
Initialized
         W=
         H=
time = 
W = 
H = 
interestingly strings |grep ST7735 yields 3 finds, so it maybe repeating the memory area??

seems to have strings from graphicstest in it as well.

versions - yep i have a problem, but i usually do take a copy under a new name and modify.

just asked the cat if she wants her tummy tickled, a single flick of her tail with a pained try it expression. :D

stephen

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest