I haven’t seen stream before and it appears quite useful except for its impact on the bootloader. Does anyone have any pointers I might look into to get to the bottom of the issue?
I’ll examine it now.
or download AMap.
16137 used / 122880 total FLASH
and for uart / jtag / swd (st-link) installs, check the *install address* or perhaps the correct ld script used. i think some installers probably use the elf addresses which basically originate in the ld scripts itself. i.e. the ld scripts is used to build the elf file (hence would have the ld script addresses), then when you install the file specifying the elf file, that address (which is the same as that in the ld script used) is where the sketch / binary gets installed.
/*
* libmaple linker script for "Flash" builds.
*
* A Flash build puts .text (and .rodata) in Flash, and
* .data/.bss/heap (of course) in SRAM, but offsets the sections by
* enough space to store the Maple bootloader, which lives in low
* Flash and uses low memory.
*/
/*
* This pulls in the appropriate MEMORY declaration from the right
* subdirectory of stm32/mem/ (the environment must call ld with the
* right include directory flags to make this happen). Boards can also
* use this file to use any of libmaple's memory-related hooks (like
* where the heap should live).
*/
MEMORY
{
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
rom (rx) : ORIGIN = 0x08002000, LENGTH = 120K
}
/* Provide memory region aliases for common.inc */
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_BSS", ram);
REGION_ALIAS("REGION_RODATA", rom);
/* Let common.inc handle the real work. */
INCLUDE common.inc
could you try this ?
connect another serial device, serial-usb block, another micro, even a nano
select it in the port monitor
program the maple mini via st-link, does it now re-enumerate?
stephen
It is possible for the sketch code to overwrite the bootloader, or erase the whole device. The bootloader updater sketch does it.
AFIK, Its not possible to protect against the code erasing its self.
I would recommend you reflash the bootloader, and comfirm it works by loading a blink sketch.
Then read back the bootloader section, and save to file ( using stlink or serial)
Then load the offending code, and run it.
Then readback the bootloader section and do a binary compare, to see if you are corrupting the bootloader and if so, is the whole section now empty.
short of writing codes that interacts with the flash controller which includes using special registers, erasing blocks and writing new blocks, it’d seem unlikely that a ‘normal’ sketch does that
just 2 cents
short of writing codes that interacts with the flash controller which includes using special registers, erasing blocks and writing new blocks, it’d seem unlikely that a ‘normal’ sketch does that
just 2 cents
@RickKimball could you post the exact command you used to burn the bootloader, I have access to st-link and (your) BMP. I did use generic_boot20_pc13.bin from Roger’s repo. I run STM32duino on Mac and *think* I originally burned the bootloader using Win7. I did try it a few times before posting my initial problem.
I had used an stlink to load the bootloader. The location of your stm32duino directory is different adjust for your configuration:
$ /home/kimballr/Arduino/hardware/stm32duino_maple/tools/linux/stlink/st-flash write generic_boot20_pc13.bin 0x08000000
//Test extEEPROM library.
//Writes the EEPROM full of 32-bit integers and reads them back to verify.
//Wire a button from digital pin 6 to ground, this is used as a start button
//so the sketch doesn't do unnecessary EEPROM writes every time it's reset.
//Jack Christensen 09Jul2014
#include <extEEPROM.h> //http://github.com/JChristensen/extEEPROM/tree/dev
#include <Streaming.h> //http://arduiniana.org/libraries/streaming/
#include <Wire.h> //http://arduino.cc/en/Reference/Wire
//Two 24LC256 EEPROMs on the bus
const uint32_t totalKBytes = 64; //for read and write test functions
extEEPROM eep(kbits_256, 2, 64); //device size, number of devices, page size
const uint8_t btnStart = 6; //start button
void setup(void)
{
pinMode(btnStart, INPUT_PULLUP);
Serial.begin(115200);
uint8_t eepStatus = eep.begin(extEEPROM::twiClock400kHz); //go fast!
if (eepStatus) {
Serial << endl << F("extEEPROM.begin() failed, status = ") << eepStatus << endl;
while (1);
}
Serial << endl << F("Press button to start...") << endl;
while (digitalRead(btnStart) == HIGH) delay(10); //wait for button push
uint8_t chunkSize = 64; //this can be changed, but must be a multiple of 4 since we're writing 32-bit integers
// eeErase(chunkSize, 0, totalKBytes * 1024 - 1);
eeWrite(chunkSize);
eeRead(chunkSize);
dump(0, 16); //the first 16 bytes
dump(32752, 32); //across the device boundary
dump(65520, 16); //the last 16 bytes
}
void loop(void)
{
}
st-link reports:
/usr/local/bin/st-flash eraseJohns-MacBook-Pro:~ john$ lsusb
Bus 026 Device 001: ID 8087:0024 Intel Corporation Hub
Bus 026 Device 002: ID 05ac:8509 Apple Inc. FaceTime HD Camera (Built-in) Serial: CC2CA802BCDGFKL0
Bus 029 Device 001: ID 8087:0024 Intel Corporation Hub
Bus 029 Device 002: ID 0424:2513 SMSC Hub
Bus 029 Device 005: ID 05ac:0253 Apple Inc. Apple Internal Keyboard / Trackpad
Bus 029 Device 003: ID 05ac:8242 Apple Inc. IR Receiver
Bus 029 Device 004: ID 0a5c:4500 Broadcom Corp. BRCM20702 Hub
Bus 029 Device 008: ID 05ac:821d Apple Inc. Bluetooth USB Host Controller
Bus 020 Device 006: ID 1eaf:0003 1eaf Maple 003 Serial: LLM 003
Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus
Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus
Bus 000 Device 001: ID 1d6b:IPPT Linux Foundation USB 3.0 Bus
Johns-MacBook-Pro:~ john$
Johns-MacBook-Pro:~ john$ lsusb
...
Bus 020 Device 006: ID 1eaf:0003 1eaf Maple 003 Serial: LLM 003
...Johns-MacBook-Pro:~ john$
Johns-MacBook-Pro:~ john$ lsusb
Bus 026 Device 001: ID 8087:0024 Intel Corporation Hub
Bus 026 Device 002: ID 05ac:8509 Apple Inc. FaceTime HD Camera (Built-in) Serial: CC2CA802BCDGFKL0
Bus 029 Device 001: ID 8087:0024 Intel Corporation Hub
Bus 029 Device 002: ID 0424:2513 SMSC Hub
Bus 029 Device 005: ID 05ac:0253 Apple Inc. Apple Internal Keyboard / Trackpad
Bus 029 Device 003: ID 05ac:8242 Apple Inc. IR Receiver
Bus 029 Device 004: ID 0a5c:4500 Broadcom Corp. BRCM20702 Hub
Bus 029 Device 008: ID 05ac:821d Apple Inc. Bluetooth USB Host Controller
Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus
Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus
Bus 000 Device 001: ID 1d6b:IPPT Linux Foundation USB 3.0 Bus
Johns-MacBook-Pro:~ john$
dfu-util -lJohns-MacBook-Pro:~ john$ dfu-util -l
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:821d] ver=0154, devnum=8, cfg=1, intf=3, path="29-3", alt=0, name="UNKNOWN", serial="UNKNOWN"
Bus 026 Device 001: ID 8087:0024 Intel Corporation Hub
Bus 026 Device 002: ID 05ac:8509 Apple Inc. FaceTime HD Camera (Built-in) Serial: CC2CA802BCDGFKL0
Bus 029 Device 001: ID 8087:0024 Intel Corporation Hub
Bus 029 Device 002: ID 0424:2513 SMSC Hub
Bus 029 Device 005: ID 05ac:0253 Apple Inc. Apple Internal Keyboard / Trackpad
Bus 029 Device 003: ID 05ac:8242 Apple Inc. IR Receiver
Bus 029 Device 004: ID 0a5c:4500 Broadcom Corp. BRCM20702 Hub
Bus 029 Device 008: ID 05ac:821d Apple Inc. Bluetooth USB Host Controller
Bus 020 Device 006: ID 1eaf:0003 1eaf Maple 003 Serial: LLM 003
Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus
Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus
Bus 000 Device 001: ID 1d6b:IPPT Linux Foundation USB 3.0 Bus
Bus 029 Device 008: ID 05ac:821d Apple Inc. Bluetooth USB Host Controller Could you load up my example code into a BP and check if you still have access to the BP while it is loaded?
http://www.stm32duino.com/viewtopic.php … 084#p27916
enableDebugPorts();Johns-MacBook-Pro:~ john$ dfu-util -l
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:821d] ver=0154, devnum=8, cfg=1, intf=3, path="29-3", alt=0, name="UNKNOWN", serial="UNKNOWN"
Found DFU: [1eaf:0003] ver=0201, devnum=28, cfg=1, intf=0, path="20-1", alt=2, name="STM32duino bootloader v1.0 Upload to Flash 0x8002000", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=28, cfg=1, intf=0, path="20-1", alt=1, name="STM32duino bootloader v1.0 Upload to Flash 0x8005000", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=28, cfg=1, intf=0, path="20-1", alt=0, name="STM32duino bootloader v1.0 ERROR. Upload to RAM not supported.", serial="LLM 003"
dfu-util -a 2 -R -D sketch.binCould you load up my example code into a BP and check if you still have access to the BP while it is loaded?
@ag123 I don’t think I know enough yet to get into the debug options you have highlighted.
@RickKimball I think you have proven the streaming.h and as you say I could bypass the problem. However, I will probably keep gnawing at the issue since I don’t like leaving issues like this to roam free.
as i do not know about your setup for debug, i’m only guessing that you may be doing debug using a different IDE (e.g. eclipse) or perhaps some scripts or another program. however, do be aware that some of the debug implementations upload the program over jtag/swd just prior to starting debug.
this overwrites the sketch installed using dfu-util (by arduino ide).
hence, you need to check your debug setup if you can prevent the sketch install over jtag/swd during debug.
alternatively, you need to set your *install address* for the debug to install the sketch at the correct address e.g. 0x8002000 rather than 0x8000000, if debug install the sketch at 0x8000000 it will simply overwrite the bootloader as well.
hence be sure u know what you are doing when using st-link



