Arduino IDE for Maple r5 program on STM32F103C8 issue

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
samtal
Posts: 12
Joined: Sun Feb 16, 2020 4:15 pm

Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by samtal »

Hi,
I have an old (9 years) Maple r5 complex program that was running well on Maple.
I am trying to port the app to a "STM32_Smart" board (resembling the STM32 Blue Pill), but have some problems in compiling.
The STM32 board runs the blink on USB OK.
I suspect that the STM32 board installation is not optimal for the more complex program (with registry and communication features).
Here are the details:
1. Running Windows 10 /64 Pro computer.
2. Board: STM32_Smart, MCU: STM32F103C8Tb
3. Run "ST Flash Loader Demonstrator" to boot the board.
4. Target: STM32F1_Med-density_64K
5. PID: 0410, Ver. 2.2
6. Selected 'Download to Device'. – Opens explorer searching for *.s19 files.
7. Selected Binary files, selected 'generic_boot20_pc13.bin' file. (out of long list of bin files)
8. Next, 'Download finished successfully', Map file: STM32F1_Med-density_64K.STmap
9. Selected Board: "Generic STM32F103C series" (and also /fake STM32F103C8)
10. USB port installed as 'COM8 (Maple Mini)' ??
11. Blink program loads from USB and runs OK.
12. A more complex previous maple r5 program that was running on Maple with various register and communications, shows many errors and will not compile.
I suspect that I have the wrong bootloader / flasher.
Can anyone come with a hint to save me the time searching and trying (with the hope I can find something...)
Attachments
Flash loader demo BW 4.jpg
Flash loader demo BW 4.jpg (57.47 KiB) Viewed 2270 times
Flash loader demo BW 3.jpg
Flash loader demo BW 3.jpg (77 KiB) Viewed 2270 times
Flash loader demo BW 2.jpg
Flash loader demo BW 2.jpg (87.92 KiB) Viewed 2270 times

stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by stas2z »

compile errors usually are not related to the bootloader

samtal
Posts: 12
Joined: Sun Feb 16, 2020 4:15 pm

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by samtal »

Thanks.
While it usually is true that compile errors are not related to the bootloader, assuming we have the correct drivers and configuration to the MCU.
As I wrote, I suspect that I did not load the correct drivers to the board I have.
There are many options for various devices and drivers' depending on the device used.

I specifically suspect the installed port that was automatically defined by the loader as "COM8 (MapleMini").
My application needs maple5 to run, and will not run on Maple mini.

I did not expect to see that Mini comment!

stevestrong
Posts: 299
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 6
Location: Munich, Germany
Contact:

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by stevestrong »

The errors may eventually have to do with the upload method you use, but not with the bootloader itself and under no circumstances with the serial port. The com port number will be automatically assigned by the host (PC).
Since your system recognized the com port as maple mini, means that the serial driver is ok.

You have to check each error message and solve them one by one.
You can also post them here, then we can say more, not only guess.

samtal
Posts: 12
Joined: Sun Feb 16, 2020 4:15 pm

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by samtal »

Thanks for the help.

It is clear that neither the computer nor the board know Maple, thus the assigned name to the port was set by the board's uploaded boot loader software.
If the software I uploaded (drivers and libraries) is for the Maple Mini, as indicated, it is not what I need. My program needs Maple-r5 which uses elevated options as compared to the Mini.
When flashing the board there are many binary file options, and I am not sure which one is the right one to fully emulate Maple-r5, and for that I ask the for help.

stevestrong
Posts: 299
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 6
Location: Munich, Germany
Contact:

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by stevestrong »

You want to port the software for the bluepill, generic STM32F103xC device.
Therefore the bootloader should be adapted to that board, in order to be able to upload onto that board.
Obviously, this is the case because the PC recognizes the board as "Maple mini". That is fine, and as it should be.
So what it actually your problem?
You have been asked to post here the error messages, but you did not. Until you do that, do not expect more support.

samtal
Posts: 12
Joined: Sun Feb 16, 2020 4:15 pm

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by samtal »

Thaks stevestrong and others,

As I indicated, my current problem is not with the program errors, (some will be gone, with the other I will cope later) but rather with the STM32_Smart board setup.
That board is probably very similar to the Blue Pill, but it does not behave exactly the same.
My question is simple:
Does anyone know which binary, (Maple)DFU, Driver and (Maple)Serial Driver are the correct ones for the a/m board?
I have seen several options, none of which works clean, as I am used with Arduino.
Thanks

stevestrong
Posts: 299
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 6
Location: Munich, Germany
Contact:

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by stevestrong »

samtal wrote:
Wed Apr 01, 2020 2:35 pm
Does anyone know which binary, (Maple)DFU, Driver and (Maple)Serial Driver are the correct ones for the a/m board?
Assuming you are talking about this board: https://stm32-base.org/boards/STM32F103 ... -V2.0.html
This has the same MCU as bluepill board, and has the LED on same PC13, so the same bootloader as for bluepill should work fine.
You also indicated that the blink sketch runs fine on that.

When you build your program, you have to select the generic STM32F193C8 series, as you did.
So it seems you have done the setup correctly.
The same serial driver as for bluepill should be installed, which you also did, that is why you get correctly indicated the serial port as "Maple Mini".

Does this answer your question?
samtal wrote:
Wed Apr 01, 2020 2:35 pm
I have seen several options, none of which works clean, as I am used with Arduino.
What do you mean under "none of which works clean"? And which options do you mean?
If the LED blinks that means your setup is ok.

A totally different story is that some part of the program written for Maple r5 may not run on this board due to missing HW support, and/or different pin distribution.
This may cause the errors during the build process and/or wrong functionality.

samtal
Posts: 12
Joined: Sun Feb 16, 2020 4:15 pm

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by samtal »

Indeed, the board I use is the one shown in the previous reply.
I did use the Generic STM32F103C, Variant C8, but I did not get upload to be Maple DFU Bootloader 2.0. It is rather "STM32duino bootloader"
I installed the Maple DFU Driver and Maple Serial Driver. (STM32 Maple DFU Drivers, _STM_COM_drivers).
The COM port is shown as "Maple Mini", which is incorrect.
I can make the USB to run and the blink and other small programs to run (like BluePill-RTClock-test and my own RT clock), but they are not stable, fail after some resets, and occasionally will not load, at time I need to reload the bootloader.
The whole system does not seem to be stable and consistent. On some program uploads the program runs (I can tell by the blinking led I add in the prog), but there is no output to the USB port (or it is sent to another, unseen port).


I suspect the Maple COM port and DFU, although installed, are not used by the system.

As for the errors: At each program upload, although it loads and run, I get the error message:

"Starting download: [##################################################] finished!
error resetting after download: usb_reset: could not reset device, win error: A device which does not exist was specified.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode"


Any idea how I can proceed?

stevestrong
Posts: 299
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 6
Location: Munich, Germany
Contact:

Re: Arduino IDE for Maple r5 program on STM32F103C8 issue

Post by stevestrong »

samtal wrote:
Wed Apr 01, 2020 6:04 pm
The COM port is shown as "Maple Mini", which is incorrect.
Well, that is actually correct. The installed USB driver on your PC recognizes and indicates the VID:PID [1eaf:004] as "MAple mini", so please accept it once and for all, and don't blame it being the cause why your program does not work in a stable manner.

You should rather focus on your program, and on the way how do you use Serial.
It is recommended to use

Code: Select all

while (!Serial); delay(10); // this waits for serial connection to be established
in your setup, and start the serial outputs only after that.

Also, before uploading, close the serial monitor. Arduino can have issues with that by uploading the program and resetting the board.

That error by uploading is "normal", so don't worry about that. It also has to do with Arduino and the host (PC) not able to manage the serial port re-enumeration correctly.

And don't suspect the drivers to cause trouble. Once the program is uploaded (100%), it means your system is up and running. You should rather check your SW.

Post Reply

Return to “IDE's”