[SOLVED] Init Failed trying to erase memory (standard Maple bootloader flashed)

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
Post Reply
dperot97
Posts: 4
Joined: Tue Aug 29, 2017 9:36 am

[SOLVED] Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by dperot97 » Tue Aug 29, 2017 2:40 pm

Hi everyone!

First of all, please tell me if I put this topic in the wrong section, or if there is a better section for it :D

I was trying to program through Serial Upload Mode (on Arduino IDE) the Maple Mini board (I got the Maple Mini as an "evaluation board", my final goal is to make a circuit that integrates the STM32F103 or similar and program it via USART). Even if i followed the instructions step by step (many times), I couldn't get to flash the program.

I tried to flash again the standard bootloader (I did it few times in the past days and it always worked), but this time i noticed that the chip doesn't even initialize the communication. I used the stm32loader.py file as usual, and i even tried to serial.write() the commands manually, but I can't get it to work.

I made sure I connected the FTDI cable correctly, that the board works in normal more, that BOOT0 = 1 and BOOT1 = 0.

Did i miss any step?

Again, I did the exact procedure few days ago flashing the factory bootloader without any problem.

The only thing I can think about is that, trying to flash the program in memory via USB and Arduino IDE (which I still can do, but not if I use the Maple IDE), I overrited some protected memory of the system memory (if possible!), damaging the system bootloader.

Do you know if I have any workaround to this problem? It's two days that I google a possible explanation / solution :D

Thanks a lot!
Daniele

SUMMARY:
- Using Kubuntu 16.04 LTS;
- Im using the Maple Mini board with STM32F103CB chip;
- I cannot effectuate any operation directly on the bootloader, not even erase the factory one to access the system one;
- I am using an FTDI cable, recognized by the OS without any problem;
- I made sure I connected the FTDI cable correcly, and i put BOOT1 = 0 BOOT0 = 1
- I can succesfully upload any program I want through the normal USB port on the board and Arduino IDE (not on Maple IDE, tho!);
Last edited by dperot97 on Thu Aug 31, 2017 10:29 am, edited 1 time in total.

victor_pv
Posts: 1682
Joined: Mon Apr 27, 2015 12:12 pm

Re: Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by victor_pv » Tue Aug 29, 2017 3:45 pm

From the post above I understand that:
1.- The ROM bootloader can not load anything.
2.- The Maple bootloader, or stm32duino bootloader can upload sketches.

In those conditions, it's possible that you have enabled some of the protections in the MCU, either the read protection, or more likely write protection to some pages.

stevestrong
Posts: 1749
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by stevestrong » Tue Aug 29, 2017 4:24 pm

Use the ST Link Flash loader demonstrator to unlock the chip:
http://www.st.com/en/development-tools/ ... stm32.html

dperot97
Posts: 4
Joined: Tue Aug 29, 2017 9:36 am

Re: Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by dperot97 » Wed Aug 30, 2017 12:12 pm

Thank you both for the fast answer.

@victor_pv yes I guess that that is exactly what is going on.

@stevestrong I will try to see if I can get the STLink device in a short amount of time and I will let you know.

Do you need other information?

By the way, I forgot to mention that the UART with Arduino doesn't work, that is: if I try get or send data to the STM32 via USB cable, I dont get any answer. Again, I can still upload sketches without many problems. Do you think it could be correlated?

Thanks a lot.
Daniele

stevestrong
Posts: 1749
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by stevestrong » Wed Aug 30, 2017 12:47 pm

Wait a moment.

So you say that you can upload over USB DFU with Arduino IDE, but not with Maple IDE?
This is normal: Maple IDE is not supported by this repository, only Arduino IDE. Forget Maple IDE.

And not all FTDI adapters work correctly, so try to use another one for flashing over serial.

dperot97
Posts: 4
Joined: Tue Aug 29, 2017 9:36 am

Re: Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by dperot97 » Wed Aug 30, 2017 1:50 pm

I found a STM32 discovery board, which I used as an STLink solution. I was succesfully able to flash the bootloader, but still I can't access the board to FTDI. I will try to download the bootloader again from Maple website and see, but I'm already happy I was able to communicate with the board =)

@stevestrong ok, thank you for the tip, but I don't think I will use the Maple IDE in the future anyway. I find it kind of incomplete =D

For who is interested in the guide I used to program the board with STLink on Ubuntu: https://github.com/rogerclarkmelbourne/ ... from-Linux

I will work on the board trying to just erase the bootloader and I will tell you. Thank you all!
Daniele

dperot97
Posts: 4
Joined: Tue Aug 29, 2017 9:36 am

Re: Init Failed trying to erase memory (standard Maple bootloader flashed)

Post by dperot97 » Thu Aug 31, 2017 10:29 am

Ok, so I erased the memory with STLink, I changed the FTDI cable I was using right now with the old one (apparently this new one was broken!) and now everything works fine.

Bootloader version 0x22
Chip id 0x410, STM32F1, performance, medium-density

Thanks everybody =)

Daniele

Post Reply