Question about CONFIG_MAPLE_MINI NO_DISABLE_DEBUG on the HyTiny boards

mitchmitchell
Wed Mar 14, 2018 5:14 am
Hello!

I am just beginning my journey setting up a MySensors network using several HyTiny boards, and I want to keep debug ports running while debugging with my BMP — I see that to prevent disabling the debug ports I need to define CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG when board.cpp is compiled. I’m assuming that this should be defined on the compiler command line so I don’t edit the file — what is the ‘best’ place to define such a conditional compilation #define when using the Arduino IDE? I’m wondering if there is a way to do it so that it is only defined when I choose the debug compilation option (-g) in the IDE?

Thanks & Best Regards,

Mitch


mitchmitchell
Wed Mar 14, 2018 5:37 am
Ah ha — found the answer — this gets defined when you use the BMP as the upload option — I missed that as I was manually uploading the program via the BMP from the Windows command link. Now I can actually try debugging MY code :D

mrburnette
Wed Mar 14, 2018 12:44 pm
ArduinoIDE architecture forces us to use the boards.txt or platform.txt files to define runline parameters. There is no easy way to see what is happening from the IDE, one just has to know what to select.

The specific flag is set in the environment here: https://github.com/rogerclarkmelbourne/ … boards.txt

For reference, we have several BMP folks in the forum, but I would expect that no one would be offended if I called Rick Kimball the resident expert on BMP as well as a many esoteric C++ topics. This link is an extension of Rick’s brain.

Ray


mitchmitchell
Wed Mar 14, 2018 3:31 pm
Thanks Ray!

I appreciate the link to Rick’s information — clearly I have a lot of reading to do :-) It was just awesome to finally be able to single step through some code on the HyTiny board while viewing the source in GDB. I’ll take a look at Rick’s posts and see what new info I can glean from there.

Thanks again,

Mitch


mitchmitchell
Thu Mar 15, 2018 9:23 pm
It seems that whenever I load a sketch using the black magic probe it wipes out the boot loader on the HyTiny board — is there a proper method to use the BMP to load a sketch that won’t destroy the boot loader?

Also, I generated an ELF file from the generic generic_boot20_hytiny.bin using arm-none-eabi-objcopy and reloading it with the BMP under GDB seems to work ‘sometimes’ — is there a way to load the bin file directly via the BMP that I should be doing? I messed up my st-link clone by foolishly letting the st.com software ‘upgrade’ its firmware and now it doesn’t seem to want to stay connected.

Thanks!

Mitch


mrburnette
Thu Mar 15, 2018 9:56 pm
[mitchmitchell – Thu Mar 15, 2018 9:23 pm] –
It seems that whenever I load a sketch using the black magic probe it wipes out the boot loader on the HyTiny board — is there a proper method to use the BMP to load a sketch that won’t destroy the boot loader?

That would be the expected outcome … that is, the BMP will upload the binary and overwrite the bootloader. There are serveral bootloaders, so only the sketch being loaded by the bootloader would be expected to “protect” the bootloader addresses.

[mitchmitchell – Thu Mar 15, 2018 9:23 pm] –
….is there a way to load the bin file directly via the BMP that I should be doing?

The WiKi has this to say (near bottom of page): http://wiki.stm32duino.com/index.php?ti … g_a_sketch
:lol: Sorry, that To-Be-Done will not help at the moment. Try searching on BMP using the “site:stm32duino.com” Google format.

Ray


mitchmitchell
Thu Mar 15, 2018 10:18 pm
LOL — got me there! Uploading the elf manually with GDB works sometimes, and I’ve not figured out what makes the difference. I’ve got several replacement st-links on order but for now if I can’t find a way to recover the one I have I’ll be stuck for a few days.

mrburnette
Thu Mar 15, 2018 10:54 pm
[mitchmitchell – Thu Mar 15, 2018 10:18 pm] –
LOL — got me there! Uploading the elf manually with GDB works sometimes, and I’ve not figured out what makes the difference. I’ve got several replacement st-links on order but for now if I can’t find a way to recover the one I have I’ll be stuck for a few days.

This is Rick’s BMP thread, it may be useful: viewtopic.php?t=122

Has the in-silicon serial bootloader been “disabled” when you flashed with official software? I use serial all the time with Blue Pills and it works well.

Ray


mitchmitchell
Fri Mar 16, 2018 12:55 am
If you are asking about the HyTiny board and not the st-link clone, then yes the serial bootloader may be disabled since no COM port shows up on my windows machine. But sometimes Windows seems a bit squirrelly when you go fiddling with USB ports — I told device manager to scan for new hardware last night and out of the blue my HyTiny COM port showed up again — but I’ve had no luck since then.

If you are asking about the st-link clone, then I don’t know, I can see it as an st-link v2 on my linux laptop in /dev (a very slow dog 32 bit machine) but st-flash won’t acknowledge it. st-info –probe sees it though so I’m puzzled about what’s going on with that.


mrburnette
Fri Mar 16, 2018 11:59 am
I was asking about the ST-Link clone.

It does seem that it is possible to reflash the software for the stlink.
http://stm32duino.com/viewtopic.php?f=3&t=1625
and
http://wiki.stm32duino.com/index.php?ti … LINK_clone

So, perhaps you could restore the clone software. Or, perhaps you could flash BMP onto the adapter.
viewtopic.php?t=1744 assuming the uC has sufficient flash.

UPDATED…
You may also see how you can install the bootloader and a sketch from the console here:
https://github.com/rogerclarkmelbourne/ … from-Linux


mitchmitchell
Sat Mar 17, 2018 12:14 am
Well its been an adventure but I ‘sort of’ got the boot loader loaded with the BMP —
1. I generated an ELF file from the generic_boot20_hytiny.bin using objcopy
arm-none-eabi-objcopy -I binary -O elf32-big generic_boot20_hytiny.bin generic_boot20_hytiny.elf

mrburnette
Sat Mar 17, 2018 12:30 am
You may want to look into building a make for your project and just compile/link from the command line:
https://www.google.com/search?q=arduino … mmand+line

Ray


zmemw16
Sat Mar 17, 2018 6:40 am
that’s the Linux influence working :lol:

btw have you rebuilt your kernel yet ?
first time i did, took 3.5hrs, last time source size 10 plus times larger and 5.5mins. and i can’t remember when last i did
srp


mitchmitchell
Sat Mar 17, 2018 7:24 am
The kernel for my linux boxes? Only once or twice just to make sure I could do it. Normally I run on the standard kernels. I did configure and build the kernel for my beaglebone black once when the official distribution accidentally left out some ham radio related modules.

mitchmitchell
Sat Mar 17, 2018 7:50 am
Well I figured out why my Arduino IDE could not find my HyTiny, it doesn’t like haveing my BMP plugged into a USB port presenting itself as a DFU capable device as well — when I unplugged it, the IDE uploaded my sketch to the HyTiny just fine.

Leave a Reply

Your email address will not be published. Required fields are marked *