mini maple upload

Maple Mini, Maple Rev3, Maple Rev 5 and Maple Ret 6, iTead Maple etc
Post Reply
frankz
Posts: 10
Joined: Sat Apr 10, 2021 8:05 am

mini maple upload

Post by frankz »

I'm on my first and a half project with STM32. the first I tried to do it with "blue pill" with 64k, but unfortunately I ran out of memory resources, and then I switched to using the mini marple with 128k.
With the blue pill everything was fine for the upload, but with the mini maple the problems started. I tried to upload the classic Blink example. the blue led on the card continues to flash (maybe the bootloader is missing?) and if I upload it with the PlatformIO platform and vs Code it gives me the error: No DFU capable USB device found.
as environment I set:

Code: Select all

[env:maple_mini_origin]
platform = ststm32
board = maple_mini_origin
framework = arduino
if I add the upload protocol:

Code: Select all

[env:maple_mini_origin]
platform = ststm32
board = maple_mini_origin
framework = arduino
upload_protocol = stlink
gives me the following error:
xPSR: 0x01000000 pc: 0x0800016c msp: 0x20005000
** Programming Started **
Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash
Error: stm32x device protected
Error: failed erasing sectors 0 to 10
embedded:startup.tcl:521: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 586
at file "embedded:startup.tcl", line 521
*** [upload] Error 1
============================================ [FAILED] Took 2.81 seconds ============================================
The terminal process "platformio 'run', '--target', 'upload', '--environment', 'maple_mini_origin'" terminated with exit code: 1.
what should I and can I do to make the card work?

P.S.
As I know. i use linux mint 20 64 bit
I connected to the board:
micro USB
ST_LINK to pins 21 SWCLK (PA14), 22 SWDIO (PA13) plus gnd
FTDI to pins 25 (PA10), 26 (PA9)
by fpiSTM » Sat Apr 10, 2021 9:46 am
First issue seems:
Error: stm32x device protected
You should first unprotected it using STM32CubeProgrammer
Go to full post
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: mini maple upload

Post by ag123 »

welcome,
do review the common quick start / faq materials
viewtopic.php?f=2&t=3
viewtopic.php?f=2&t=301

you'd need to figure out which core you are running and mention it here
and if you are using st-link, you would need to select that as the upload method
these days maple mini's are clones, so u'd find the schematics etc here
https://github.com/leaflabs/maplemini
and e.g. the led pin is at a different pin and is active high
maple mini and blue pill both has 20k sram (stm32f103c{8,b})
some maple mini has a cb which has 128k flash (it is discovered that some blue pills has 'extra' flash despite that the official specs says 64k)
then in the wild there are fake boards, and some boards us a 'clone' stm32 like mcu which may not be stm32

the specs sheets
https://www.st.com/en/microcontrollers- ... 103cb.html
and a reference manual called rm0008 are useful, you can find it in 'documents' on the web
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: mini maple upload

Post by fpiSTM »

First issue seems:
Error: stm32x device protected
You should first unprotected it using STM32CubeProgrammer
frankz
Posts: 10
Joined: Sat Apr 10, 2021 8:05 am

Re: mini maple upload

Post by frankz »

the card and the pin are those included in the previous link

https://www.stm32duino.com/viewtopic.php?f=2&t=3

the memory should be 128k as seen at compile time
Checking size .pio/build/maple_mini_origin/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 4.8% (used 844 bytes from 17408 bytes)
Flash: [= ] 9.1% (used 10012 bytes from 110592 bytes)
if I set the upload protocol with st-link it gives me the following error:
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink
CURRENT: upload_protocol = stlink
Uploading .pio/build/maple_mini_origin/firmware.elf
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:27)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

hla_swd
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800016c msp: 0x20005000
** Programming Started **
Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash
Error: stm32x device protected
Error: failed erasing sectors 0 to 10
embedded:startup.tcl:521: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 586
at file "embedded:startup.tcl", line 521
*** [upload] Error 1
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: mini maple upload

Post by ag123 »

there is one thing you can try, press and hold the reset pin while you click flash
sometimes it works. it is called 'connect under reset'
but for what is worth, you need to check your core settings or sketch as well and make sure you did not disable the debug ports.
check in the settings for the core. normally for the stm32duino cores, the debug ports aren't disabled.
but in case what you are using disabled the debug ports.
pressing and holding reset while flashing may help

they other way is like what fpistm mentioned, try with stm32cube programmer. use that to unprotect the device, if it is protect maybe it is not simply because the debug pins are disabled
frankz
Posts: 10
Joined: Sat Apr 10, 2021 8:05 am

Re: mini maple upload

Post by frankz »

Ok. I reset everything with stm32cubeprogrammer.
Now everything works, but I'm struggling with another kind of problem due to the mcufriend_kvb library, which I'm checking out.
anyway thank you.
Post Reply

Return to “Maple & Maple mini etc”