I have the following STM32F103C8T6 ARM STM32 Minimum System Development Board Module and would like to get started using it under OS X. I also have a STM Nucleo F411RE board with the ST-LINK/V2-1 and a FT232RL USB to Serial adapter module.
Can someone please guide me into getting going under OSX? ![]()
https://www.youtube.com/watch?v=G_RF0a0hrak
That would show you how to wire up the ftdi and use the Serial upload method in the IDE.
https://github.com/rogerclarkmelbourne/ … /Apple-OSX
I got everything downloaded and installed. Compiling the obligatory Blink goes without a hitch, but when trying to upload, I get the following:
stm32flash 0.4
Cannot handle device "/dev/cu.usbserial-A943NTHT"
Failed to open port: /dev/cu.usbserial-A943NTHT
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
You should be able to select your board and compile code for the generic f103c8. You need to make sure you have the FTDI device selected as the Port. Make sure the BOOT0 jumper is connected high. Then press the reset on your f103c8 board. It should go into the stm32f103 built-in serial boot loader mode. Then just press uploaded. If it doesn’t take, try pressing reset again and uploading. If that doesn’t work your serial wiring connections are wrong, or you have the wrong FTDI device selected. Or there is some other OSX related issue.
https://github.com/rogerclarkmelbourne/ … /Apple-OSX
*****************************************************************
* *
* STM32×îСϵͳ°åRTC²âÊÔºóÑ»·µãÁÁPC13¶ËµÄLED! ^_^ *
* *
*****************************************************************
·¢ÉúÒ»´ÎÍⲿ¸´Î»....
²»ÐèÒªÉèÖÃRCT....
Time: 2013-11-13 02:31:50
If you upload using a USB to Serial adaptor, the you need to select “Serial” on the Upload method menu
You also need to have Boot0 jump link in the other position i.e Boot0 HIGH
After the upload is complete, the code will run
However if you press the reset button, or you disconnect the power etc, the board will return to the upload mode (built in serial bootloader)
Re: Strange character in the Serial Monitor
Did you set the baud rate e.g Serial.begin(115200) and check you have the same setting in the serial monitor.
re: STM Nucleo F411RE
This may not work at all on OSX, It will depend if the Stlink firmware is compatible with the Open Source STLink uploader we use, which is Texane-STlink
You could try using the Discovery F407 option, but if it doesnt work, we don’t have a solution at the moment.
However I intend to see if OpenOCD will work in place of Texane STLink when I get time.
(Note this is an OSX issue, because as far as I’m aware, STM don’t support uploads via STLink on OSX at all, so we can’t even use a closed source uploader on OSX (like we can on Windows)
(Note this is an OSX issue, because as far as I’m aware, STM don’t support uploads via STLink on OSX at all, so we can’t even use a closed source uploader on OSX (like we can on Windows)
re: STLink on OSX
Sorry. What I said was a bit confusing
As far as I’m aware STM don’t produce any software utils that allow upload to STLink devices on OSX or Linux, but they do have a Windows GUI and CLI version
http://www.st.com/web/en/catalog/tools/PF258168
However there is the open source Texane STLink
https://github.com/texane/stlink
which we use on OSX and Linux.
We used to use it on Windows as well, but it doesn’t seem to work with some STLink boards (specifically on some F4 boards, and it doesnt work with my Nucleo F3 board).
So on Windows, I reverted back to the STM (closed source) CLI exe I download from STM’s website and added to the repo (As far as I could tell, STM’s license allows this)
So I think you are partially lucky that the boards you have, work with Texane STlink.
Apparently (information from Rick Kimball), it OpenOCD http://openocd.org/ is compatible with STLink devices and may support a wider range of STLink firmwares (but the version of OpenOCD needs to have STLink compiled into it – ie its optional)
So if I get chance will try to test using OpenOCD as an alternative to Texane STLink, mainly for OSX and Linux
I am using OS X 10.9.5 with Arduino IDE 1.6.4. My USB to serial device is as stated in my first post, as well as my STM32F1 board.
My Arduino IDE settings are as follows:
- Board: Generic STM32F103C Series
- Variant: STM32F103C8 (20k RAM 64k Flash)
- Upload method: Serial
- Port: /dev/cu.usbserial-A943NTHT
Example program:
void setup() {
// initialize digital pin PC13 as an output.
pinMode(PC13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PC13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a half second
digitalWrite(PC13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
There are other alternatives, but you will need to do some code modification
There is a python version of the serial uploader in the tool/win folder,
stm32loader.py
If you look in serial_upload.bat (in tools/win) at line 12
rem: C:\Python27\python.exe stm32loader.py -e -w -p %1 -g -b 115200 %str%
As per your instructions, I added the following (modified) line to serial_upload:
python $(dirname $0)/stm32loader.py -e -w -p /dev/”$1″ -g -b 115200 “$4”
This did the trick
“Thank you” to everyone that helped me to get this working ![]()
I’m glad it works for you.
If i get chance I will added the line to the script, but comment it out, so that if anyone else has a problem with their USB to Serial device not being compatible with STM32Flash they can try python instead.
Actually, thinking about it, I had a similar issue on Windows.
On Windows the problem was that it would only handle path COM numbers from 1 to 9 and not handle double digits.
Its possible that the issue that STM32flash on OSX has a limit on the max length of the device name.
I think you said your device name was
/dev/cu.usbserial-A943NTHT
or perhaps the issue is case sensitivity ???
I suspect it may be possible to fix STM32Flash and the source is in /tools/src/stm32flash_serial/src
Anyway. I will log this as a bug in GitHub in case anyone wants to look for possible causes and fixes
Within the next 10 days, I will be getting a CH340 USB 2.0 To TTL Serial Converter which I will test with stm32flash, and report back here ![]()
Thanks.
I suspect the problem is a small bug in STM32Flash, which you may be able to fix, but its not possible for me to fix, as all my USB serial adpators work OK on OSX, so I can’t replicate your problem
crw-rw-rw- 1 root wheel 18, 64 Jun 1 13:15 tty.usbserial-A943NTHT
I then went to the stm32flash directory, and executed:
./stm32flash /dev/tty.usbserial-A943NTHT
instead of:
./stm32flash /dev/cu.usbserial-A943NTHT
and the result is:
stm32flash 0.4
http://stm32flash.googlecode.com/
Interface serial_posix: 57600 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (Medium-density)
- RAM : 20KiB (512b reserved by bootloader)
- Flash : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Ok.
Looks like an issue with the IDE reporting the incorrect serial device ?
But if you do. Remember the arm compiler is not installed by default after 1.6.2 so you have to install the due to get it back.
Could something like this be useful? If so, where must I paste the code?
Again, thank you to everyone for helping, and being patient with me ![]()
Thanks.
Sounds like a strange “feature” to me, if they hide some ports.
But at least we know what was wrong
I’m trying to play with a Maple Mini v3 : http://www.ebay.com.au/itm/400766548945
on OSX, believe I’ve diligently followed all the install instructions here : https://github.com/rogerclarkmelbourne/ … stallation
1) When I compile an example program from here : https://www.hackster.io/rayburne/oled-on-the-cheap
I get this – Adafruit_GFX.cpp:5:28: fatal error: .\Adafruit_GFX.h: No such file or directory
#include “.\Adafruit_GFX.h”
^
compilation terminated.
Error compiling.
2) I can see the Boards in the Arduino IDE, but no Serial Port.
If I go to terminal and ls /dev/tty.usb*, see nothing (not sure if that is a valid test)
Any tips?
Thanks
Which version of OSX are you using ?
I suspect the reason you can’t see any serial ports is that the vendor didn’t upload a valid program, e.g. Blink into the maple mini.
Anyway, what you need to do is put the board into perpetual bootloader mode.
Press reset then press and hold the other button, for about 2 seconds until the led appears to be flashing about twice a second.
When you release the button the led should continue to flash.
At this point the board is locked into an upload mode, and there is no serial device (but that’s fine).
Compile and upload and empty sketch, and you should then have a serial device.
Do you see any USB ports appearing in the IDE at all, which could be the Maple mini?
Also, see the previous few postings, there appears to be a feature in the IDE which hides some ports, so you may need to edit the preferences file for the IDE (unfortunately we have no control over what the IDE team do)
You could also look in the system profiler
https://pim.famnit.upr.si/blog/index.ph … lsusb.html
Re: issue with specific example.
Umm. I suspect its the example that’s the issue not the mac.
Try compiling blink to start with. The pin for the led on a maple mini is
PB1
(Note Leaflabs chose to use Arduino style pin numbers on their boards, which is fine if you have a maple mini, however a lot of people are using non maple hardware and we tend to use the real names for the pins, e.g PB1 , I.e Port B pin 1)
Note.
I did an update to fix OSX about 8 hours ago, without that update the board does not reset prior to upload, and had to be done manually.
See the announcements section, as you may need to update your files, or download a whole new copy.
To answer some questions, using latest OSX
When I power up Maple Mini the LED does flash slowly, would that be Blink, or is that a Status LED?
I see no serial ports at all…..
Will revert later…. Thanks!
To answer some questions, using latest OSX
When I power up Maple Mini the LED does flash slowly, would that be Blink, or is that a Status LED?
I see no serial ports at all…..
Will revert later…. Thanks!
I did the DFU Install as per : https://github.com/rogerclarkmelbourne/ … stallation
“Install DFU Utils. The easiest way to do this is to use Homebrew http://brew.sh/ – see the bottom of the Homebrew page.
Then type “brew install dfu-util” in the terminal window to install”
I see “Serial”… But no tty.usbModemxxxxx (where xxxxx seems to vary)
…
I see “Serial”… But no tty.usbModemxxxxx (where xxxxx seems to vary)
I think its more likely just to be the bootloader, as the clone Maple mini boards don’t always have blink installed because the vendors don’t want the bother of installing blink as well as installing the bootloader.
BTW.
When you get it working, you should probably re-flash the bootloader. The ones that the cloned maple minis come with is the original bootloader written in 2012 by leaflabs
We have recently re-worked the bootloader and uploads are now substantially faster on OSX (and Linux), and you also gain 12k of Flash and 3k of RAM, as the stm32duino-bootloader is compiled with optimisations that the original one wasn’t.
If the flash is on for 1 sec off for 1 sec is likely to be blink.
If its on for 1/2 sec off for 1/2 sec is probably the bootloader saying its got nothing to run. In which case you won’t have a serial device.
So just upload an empty sketch, and you should then see a serial device (name seem to vary)
In meantime, this is what I see when I plug in…. (somebody here might notice what I am trying to build!)
Thanks!
The flash rate looks like its in DFU upload mode, i.e blink has not been installed.
So just ignore that you cant see the maple usb serial device (it won’t be running as its stuck in the bootloader, as there is no valid code for the bootloader to run
The bootloader checks the program start address (0x8005000 on your maple with the old bootloader ), and if it can’t find a valid stack pointer address in the first 4 bytes, it stays waiting for DFU upload.
Re: The display you are using.
I have one of those, but have not tested it. From what I recall @madias has used that display.
I think you may be using Ray’s example code sorry I cant remember who has written which lib and which example code
But, I think there is a strong chance you will get this to work fairly easily
Tomorrow I will solder the header pins, and try the new bootloader ![]()
see one of the other sections (sorry i cant remember which one), but the ground plane on some Maple minis is now very close to the pins.
so when soldering, make sure you don’t accidentally short any pins to Gnd
see one of the other sections (sorry i cant remember which one), but the ground plane on some Maple minis is now very close to the pins.
so when soldering, make sure you don’t accidentally short any pins to Gnd
Tried a complete new try on another Mac…. i have the odd issue on my iMac when doing Arduino stuff and it not recognising certain USB chipsets…. but always works on this mac!
Complete install as per instructions…. but when I try to compile….
Cannot run program “{runtime.tools.arm-none-eabi-gcc.path}/bin/arm-none-eabi-g++” (in directory “.”): error=2, No such file or directory
Any ideas?
<…>
Cannot run program “{runtime.tools.arm-none-eabi-gcc.path}/bin/arm-none-eabi-g++” (in directory “.”): error=2, No such file or directory
Any ideas?
Doing now…
While I’m doing that – based on my board http://i.imgur.com/UJ9UIqq.jpg which board in the Arduino IDE should I select?
Thanks!
The ARM compiler used to be installed by default, but the IDE team are continually messing around with whether the ARM compiler is installed by default, and even where they put it.
its possible the IDE team have screwed something up on 1.6.5 on OSX. I know they messed up on Windows and had to release a 1.6.5.r2, so its possible that there are bugs in the OSX version of 1.6.5 for third party cores that you are the first to encounter
I’d recommend you install 1.6.4 and then use the Boards manager to install the Due, this will then give you the ARM compiler in the correct location.
Or go over the dark side and use Arduino.org’s copy of the Arduino IDE which installs the ARM compiler by default.
Doing now…
While I’m doing that – based on my board http://i.imgur.com/UJ9UIqq.jpg which board in the Arduino IDE should I select?
Thanks!
I’m nearly there (I think)….
So Boards Manager installed, now compiles Blink cleanly…
I press and try all permutations of “Anyway, what you need to do is put the board into perpetual bootloader mode.
Press reset then press and hold the other button, for about 2 seconds until the led appears to be flashing about twice a second.
When you release the button the led should continue to flash.”
I do however have a Serial Port showing at bottom of IDE Window : http://i.imgur.com/JyxKTxQ.png
Upon upload I get this :
Sketch uses 12,764 bytes (11%) of program storage space. Maximum is 108,000 bytes.
Global variables use 3,264 bytes of dynamic memory.
java.io.IOException: Cannot run program “/Users/anthonyjclarke/Documents/Arduino/hardware/Arduino_STM32/tools/macosx/maple_upload”: error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:115)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:158)
at processing.app.debug.Compiler.upload(Compiler.java:165)
at processing.app.Sketch.upload(Sketch.java:1167)
at processing.app.Sketch.exportApplet(Sketch.java:1141)
at processing.app.Sketch.exportApplet(Sketch.java:1113)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
… 11 more
I’ve not seen that error before.
can you try setting the permissions on that script.
i did make a change to the maple-upload script during the week and i wonder if somehow the permissions that get uploaded to github got screwed up.
also make sure the permissions on the upload-reset binary are ok, as its a new file i added this week.
Whilst I cant select a Serial Port, I load Blink…. and it compiles and uploads (see below)…. issue here is no blinking LED…
but I can get to that later!
Binary sketch size is reported above. Check it against a 17000 byte maximum.
Loading via dfu-util
Resetting to bootloader via DTR pulse
Reset via USB Serial Failed! Did you select the serial right serial port?
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming…
Searching for DFU device [1EAF:0003]…
Found it!
Opening USB Device 0x1eaf:0x0003…
Found Runtime: [0x1eaf:0x0003] devnum=0, cfg=0, intf=0, alt=0, name=”DFU Program RAM 0x20000C00″
Claiming USB DFU Interface…
Setting Alternate Setting …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=256
Starting download: [##################################################] finished!
error resetting after download: usb_reset(ResetDevice): unknown error
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
there is no harm in using the Maple IDE, but you will miss out on a lot of new stuff.
i know one or two people have found that installing the Maple IDE, magically fixed their Arduino IDE issues, but in your case I’m not sure if thats the case.
it just sounds like a permissions issue on one of the files.
i will check my mac to see if i need to widen the permissions on the new upload-reset file
nthonys-MBP-2:macosx anthonyjclarke$ ls -l
total 32
-rw-rw-rw-@ 1 anthonyjclarke staff 827 14 Jun 18:05 maple_upload
-rw-r–r–@ 1 anthonyjclarke staff 90 14 Jun 18:05 serial_upload
drwxrwxrwx@ 8 anthonyjclarke staff 272 20 Jun 08:36 stlink
-rw-r–r–@ 1 anthonyjclarke staff 64 14 Jun 18:05 stlink_upload
drwxrwxrwx@ 3 anthonyjclarke staff 102 17 Jun 09:12 stm32flash
-rw-r–r–@ 1 anthonyjclarke staff 420 14 Jun 18:05 upload_router
Sounds like the permissions are screwed up
mine are
-rwxr-xr-x 1 administrator staff 1377 16 Jun 21:23 maple_upload
-rwxr-xr-x 1 administrator staff 90 8 Feb 18:01 serial_upload
drwxr-xr-x 8 administrator staff 272 7 Apr 08:04 stlink
-rwxr-xr-x 1 administrator staff 64 8 Feb 18:01 stlink_upload
drwxr-xr-x 4 administrator staff 136 7 Apr 08:01 stm32flash
-rwxr-xr-x 1 administrator staff 9424 16 Jun 21:17 upload-reset
-rwxr-xr-x 1 administrator staff 420 8 Feb 18:01 upload_router
Changed File Permissions….
Uploaded this :
void setup() {
// initialize digital pin 13 as an output.
pinMode(PB1, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PB1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PB1, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
But no flashing LED anymore… maybe I don’t have one on my Board ![]()
Output :
Sketch uses 12,564 bytes (11%) of program storage space. Maximum is 110,592 bytes.
Global variables use 3,104 bytes of dynamic memory.
dfu-util 0.8
dfu-util: Invalid DFU suffix signature
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to [email protected]
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device…
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface…
Setting Alternate Setting #1 …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
Download [ ] 0% 0 bytes
Download [= ] 7% 1024 bytes
Download [=== ] 15% 2048 bytes
Download [===== ] 22% 3072 bytes
Download [======= ] 30% 4096 bytes
Download [========= ] 37% 5120 bytes
Download [=========== ] 45% 6144 bytes
Download [============= ] 52% 7168 bytes
Download [=============== ] 60% 8192 bytes
Download [================ ] 67% 9216 bytes
Download [================== ] 75% 10240 bytes
Download [==================== ] 82% 11264 bytes
Download [====================== ] 90% 12288 bytes
Download [======================== ] 97% 12564 bytes
Download [=========================] 100% 12564 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
dfu-util: error resetting after download
It definitely looks like its uploading.
Try using Serial and see if something prints out.
e.g.
#define LEDPIN PB1
void setup() {
// put your setup code here, to run once:
pinMode(LEDPIN,OUTPUT);
Serial.begin(115200); // not really needed on Maple
}
int c;
void loop() {
// put your main code here, to run repeatedly:
Serial.println(c++);
digitalWrite(LEDPIN, !digitalRead(LEDPIN));
delay(500);
}
original bootloader
uploaded on 2 different maple minis
both worked fine for me.
I have seen the old bootloader sometimes not reset after upload
When you get chance can you tell me how you did the original install of the files e.g. downloaded the zip and unzipped or cloned the repo
As I’ve not had any issues with permissions on binary files before, but this could be a new OSX version issue
Basically I think its a combination of things and I suspect my problem may not be representative…
1) I do have issues on the iMac with USB drivers / Arduino connections, one chipset (and I cant recall which) just doesnt work… so I head over to my MacBook Pro that it does work on.
2) my Arduino install has all my files stored in Documents (default)… and I have a Cloud Sync (www.sugarsync.com) sync across all my devices….
I could compile originally on my iMac, but not on the Macbook so, I suspect the cloud sync may have been the issue… will never know..
3) Did installing the Maple IDE (as you mentioned) fix it up!?
Sorry, not sure if this helps… but I did want to say a big thank you… you and Ray got me sorted…. onward and upward….
Oh, do you have a “Tip Jar?” ![]()
It looks like cloud sync is not retaining file permissions, but I guess they only expect people to sync documents.
However, I presume it is working for you on at least one machine now?
Thanks for all your help!
No worries.
BTW. If you start to feel adventurous, there is a better bootloader for the Maple mini which upload much much faster on OSX, but I’d get settled in with things for a while until you feel a bit more comfortable with the whole ecosystem before trying to reflash it.
I know Victor did an update sketch, which you can run which updates the existing bootloader, but I can’t find where it is at the moment
I’ll look for it and post and update
@Kenjutsu
Sorry. I can’t find the bootloader updater sketch. I’m not sure if Victor_pv removed the git repo with it in. I’m sure he will have a copy that he can repost.
Apart from using the updater sketch, you’d need to flash using a USB to Serial adapter – if you have one of those, you can use stm32flash to upload the new binary.
https://github.com/rogerclarkmelbourne/ … boot20.bin
Note there is a design flaw on the Maple mini which prevents it reliably going into serial bootloader mode, you need to pull the pin Boot1 LOW, and the hold the Button down, while pressing and releasing the reset button.
Once you do that sequence and attach a USB to Serial adpator to RX and TX (Serial 1), you can upload.
However its much easier to wait for Victor to repost his sketch. I will PM him
RogerClark wrote:I think the information about updating the Maple mini clone is scattered around a bit.
I know Victor did an update sketch, which you can run which updates the existing bootloader, but I can’t find where it is at the moment
I’ll look for it and post and update
I PMed Victor but he’s not got back to me. i know its a busy time of year for everyone.
I will add the updater sketch to the bootloader repo, as its by far the easiest way for Maple mini users to update.
Generic board users would have already needed to initially upload via usb to serial, so I don’t think its worth me building a version for the Red or Blue pill etc.
However i wish there was documentation on how the Burn Bootloader thing works in the IDE, as it would be useful for the generic boards.
i think it needs a file called Programmers.txt, but AFIK, they third part hardware docs doesn’t show how to write this file
I’ve taken Ray’s version and combined it into one file and included the bootloader data inside the sketch so that its self contained.
I’ve cleaned up the messages and the comments etc
I’ve tested on an original a Maple mini running the original maple bootloader (downloaded from leaflabs site), and also with updating its self !
/**
*
* Maple Mini bootloader updater sketch.
* Based on sketch from Gregwar for Robotis OpenCM9.04, which is based on Maple bootloader code.
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* WARNING WARNING
* WARNING This comes with NO WARRANTY, you use it at your own risk WARNING
* WARNING WARNING
* WARNING Please read this warning text and the instructions below WARNING
* WARNING WARNING
* WARNING Running this sketch will erase your bootloader replace it WARNING
* WARNING with the new STM32duino bootloader WARNING
* WARNING WARNING
* WARNING Only use this sketch with Maple mini boards. WARNING
* WARNING WARNING
* WARNING Note. If your bootloader does get messed up, it is possible WARNING
* WARNING to reflash using an external USB to Serial adaptor or another WARNING
* WARNING Arduino board (to act as a USB to Serial device) WARNING
* WARNING WARNING
* WARNING For more information see www.stm32duino.com WARNING
* WARNING WARNING
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
*
* Instructions.
*
* Upload this sketch onto your Maple mini.
*
* After upload the LED on the board should start to flash slowly (on for 1 sec off for 1 sec)
*
* Open the Serial Monitor and follow the on screen instructions
*
* If the version of the bootloader that is contained in this sketch is already installed,
* a message is displayed and you will not be prompted to update.
*
* If prompted to update, press Y to agree and reflash the bootloader
*
* After the update has finished, the sketch will wait for you to manually reset the board
* or to upload a new sketch
*
* If you just reset the board. This sketch will run again, as it will not be touched by the bootloader update
* However it will display the message to indicate that this bootloader has already been installed
*
* For support please register to www.stm32duino.com
*
* Credit goes to Victor PV, Matthis, Ray.
*
* For source code and binaries for the bootloader see
* www.github.com/rogerclarkmelbourne/stm32duino-bootloader
*
* See also www.rogerclark.net
*
*/
// Data of bootloader
const char maple_mini_boot20[7100] = {
0x00, 0x50, 0x00, 0x20, 0x6D, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0x39, 0x05, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08,
0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0xB5, 0x01, 0x00, 0x08, 0x5F, 0xF8, 0x08, 0xF1,
0x30, 0xBF, 0x70, 0x47, 0x20, 0xBF, 0x70, 0x47, 0x40, 0xBF, 0x70, 0x47, 0xBF, 0xF3, 0x6F, 0x8F,
0x70, 0x47, 0xBF, 0xF3, 0x4F, 0x8F, 0x70, 0x47, 0xBF, 0xF3, 0x5F, 0x8F, 0x70, 0x47, 0x01, 0xDF,
0x70, 0x47, 0xEF, 0xF3, 0x14, 0x80, 0x70, 0x47, 0x80, 0xF3, 0x14, 0x88, 0xBF, 0xF3, 0x6F, 0x8F,
0x70, 0x47, 0xEF, 0xF3, 0x09, 0x80, 0x70, 0x47, 0x80, 0xF3, 0x09, 0x88, 0x70, 0x47, 0xEF, 0xF3,
0x08, 0x80, 0x70, 0x47, 0x80, 0xF3, 0x08, 0x88, 0x70, 0x47, 0x62, 0xB6, 0x70, 0x47, 0x72, 0xB6,
0x70, 0x47, 0xEF, 0xF3, 0x10, 0x80, 0x70, 0x47, 0x61, 0xB6, 0x70, 0x47, 0x71, 0xB6, 0x70, 0x47,
0xEF, 0xF3, 0x13, 0x80, 0x70, 0x47, 0x80, 0xF3, 0x11, 0x88, 0x70, 0x47, 0xEF, 0xF3, 0x12, 0x80,
0x70, 0x47, 0x40, 0xBA, 0x70, 0x47, 0x00, 0xBA, 0x70, 0x47, 0x00, 0x00, 0x00, 0x21, 0x00, 0xF0,
0x04, 0xB8, 0x0B, 0x4B, 0x5B, 0x58, 0x43, 0x50, 0x04, 0x31, 0x0A, 0x48, 0x0A, 0x4B, 0x42, 0x18,
0x9A, 0x42, 0xFF, 0xF4, 0xF6, 0xAF, 0x09, 0x4A, 0x00, 0xF0, 0x03, 0xB8, 0x00, 0x23, 0x42, 0xF8,
0x04, 0x3B, 0x07, 0x4B, 0x9A, 0x42, 0xFF, 0xF4, 0xF9, 0xAF, 0x00, 0xF0, 0x27, 0xFA, 0x70, 0x47,
0xB4, 0x18, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x08, 0x03, 0x00, 0x20, 0x08, 0x03, 0x00, 0x20,
0x4C, 0x03, 0x00, 0x20, 0xFF, 0xF7, 0xFE, 0xBF, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47, 0x03, 0x28,
0x8C, 0xBF, 0x02, 0x20, 0x00, 0x20, 0x70, 0x47, 0x70, 0x47, 0x00, 0x00, 0x03, 0x4B, 0x1B, 0x68,
0x9B, 0x7A, 0x13, 0xB1, 0x02, 0x4B, 0x05, 0x22, 0x1A, 0x60, 0x70, 0x47, 0x44, 0x03, 0x00, 0x20,
0x50, 0x03, 0x00, 0x20, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47,
0x01, 0x4B, 0x04, 0x22, 0x1A, 0x60, 0x70, 0x47, 0x50, 0x03, 0x00, 0x20, 0x10, 0xB5, 0x00, 0xF0,
0x0F, 0xFC, 0x21, 0x4B, 0x21, 0x4A, 0x1B, 0x68, 0x00, 0x24, 0x12, 0x68, 0x9C, 0x72, 0xD2, 0x79,
0x20, 0x46, 0x5A, 0x72, 0x1E, 0x4A, 0x1F, 0x4B, 0x14, 0x60, 0x19, 0x68, 0x21, 0xF4, 0xEC, 0x41,
0x21, 0xF0, 0x70, 0x01, 0x41, 0xF4, 0x00, 0x71, 0x89, 0xB2, 0x19, 0x60, 0x19, 0x68, 0x21, 0xF4,
0xE0, 0x41, 0x21, 0xF0, 0x40, 0x01, 0x89, 0xB2, 0x81, 0xF0, 0x10, 0x01, 0x19, 0x60, 0x11, 0x68,
0x15, 0x4B, 0x89, 0xB2, 0x0B, 0x44, 0x5B, 0x00, 0x40, 0x21, 0x19, 0x60, 0x13, 0x68, 0x80, 0x22,
0x9B, 0xB2, 0x03, 0xF1, 0x00, 0x53, 0x03, 0xF5, 0x40, 0x53, 0x5B, 0x00, 0x1A, 0x60, 0x00, 0xF0,
0xBB, 0xFD, 0x0E, 0x4B, 0x20, 0x46, 0x1B, 0x68, 0x93, 0xF8, 0x30, 0x10, 0x00, 0xF0, 0x0C, 0xFE,
0x20, 0x46, 0x00, 0xF0, 0xA2, 0xFD, 0x0A, 0x4B, 0x01, 0x22, 0x20, 0x46, 0xBD, 0xE8, 0x10, 0x40,
0x1A, 0x60, 0x01, 0xF0, 0xA3, 0xBA, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20, 0xF8, 0x02, 0x00, 0x20,
0x50, 0x5C, 0x00, 0x40, 0x00, 0x5C, 0x00, 0x40, 0x04, 0x30, 0x00, 0x20, 0x1C, 0x03, 0x00, 0x20,
0x50, 0x03, 0x00, 0x20, 0x38, 0xB5, 0x12, 0x4B, 0x05, 0x46, 0x1A, 0x68, 0x1C, 0x46, 0x12, 0x78,
0x02, 0xF0, 0x7F, 0x02, 0x21, 0x2A, 0x19, 0xD1, 0x00, 0xF0, 0x48, 0xFC, 0xB0, 0xB1, 0x68, 0x1E,
0x04, 0x28, 0x13, 0xD8, 0xDF, 0xE8, 0x00, 0xF0, 0x03, 0x05, 0x07, 0x12, 0x09, 0x00, 0x09, 0x4B,
0x04, 0xE0, 0x09, 0x4B, 0x02, 0xE0, 0x09, 0x4B, 0x00, 0xE0, 0x09, 0x4B, 0x22, 0x68, 0x00, 0x24,
0x20, 0x46, 0x93, 0x61, 0x54, 0x82, 0x98, 0x47, 0x20, 0x46, 0x38, 0xBD, 0x02, 0x20, 0x38, 0xBD,
0x44, 0x03, 0x00, 0x20, 0x95, 0x0A, 0x00, 0x08, 0xBD, 0x0A, 0x00, 0x08, 0x7D, 0x0A, 0x00, 0x08,
0x65, 0x0A, 0x00, 0x08, 0x01, 0x49, 0x01, 0xF0, 0x61, 0xB8, 0x00, 0xBF, 0x44, 0x01, 0x00, 0x20,
0x01, 0x49, 0x01, 0xF0, 0x5B, 0xB8, 0x00, 0xBF, 0xF8, 0x02, 0x00, 0x20, 0x05, 0x4B, 0x1B, 0x68,
0x9B, 0x78, 0x07, 0x2B, 0x04, 0xD8, 0x04, 0x49, 0x01, 0xEB, 0xC3, 0x01, 0x01, 0xF0, 0x4E, 0xB8,
0x00, 0x20, 0x70, 0x47, 0x44, 0x03, 0x00, 0x20, 0x94, 0x00, 0x00, 0x20, 0x01, 0x49, 0x01, 0xF0,
0x45, 0xB8, 0x00, 0xBF, 0xE0, 0x00, 0x00, 0x20, 0x08, 0xB5, 0x08, 0x4B, 0x1B, 0x68, 0x1B, 0x78,
0x03, 0xF0, 0x7F, 0x03, 0x21, 0x2B, 0x06, 0xD1, 0x00, 0xF0, 0xF8, 0xFB, 0x00, 0x28, 0x0C, 0xBF,
0x02, 0x20, 0x00, 0x20, 0x08, 0xBD, 0x02, 0x20, 0x08, 0xBD, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20,
0x38, 0xB5, 0x13, 0x4C, 0x09, 0x20, 0x25, 0x68, 0x00, 0xF0, 0x06, 0xFB, 0x28, 0x40, 0x40, 0xF0,
0x50, 0x05, 0x25, 0x60, 0x04, 0x3C, 0x20, 0x46, 0x09, 0x21, 0x01, 0x22, 0x00, 0xF0, 0x88, 0xF9,
0x20, 0x46, 0x00, 0x22, 0x09, 0x21, 0x00, 0xF0, 0x83, 0xF9, 0x00, 0xF0, 0x07, 0xFB, 0x09, 0x4B,
0xC2, 0xB2, 0x18, 0x60, 0x08, 0x4B, 0xC0, 0xF3, 0x07, 0x20, 0x83, 0xF8, 0x29, 0x20, 0x83, 0xF8,
0x2A, 0x00, 0x06, 0x4B, 0x5A, 0x71, 0x98, 0x71, 0xBD, 0xE8, 0x38, 0x40, 0x00, 0xF0, 0x2E, 0xBE,
0x04, 0x0C, 0x01, 0x40, 0x08, 0x03, 0x00, 0x20, 0xEC, 0x00, 0x00, 0x20, 0x29, 0x01, 0x00, 0x20,
0x04, 0x4B, 0x1A, 0x68, 0x92, 0xB2, 0x42, 0xF0, 0x0C, 0x02, 0x1A, 0x60, 0x02, 0x4B, 0x03, 0x22,
0x1A, 0x60, 0x70, 0x47, 0x40, 0x5C, 0x00, 0x40, 0x50, 0x03, 0x00, 0x20, 0x04, 0x4B, 0x4F, 0xF6,
0xFB, 0x72, 0x19, 0x68, 0x0A, 0x40, 0x1A, 0x60, 0x4F, 0xF4, 0x3F, 0x42, 0x1A, 0x60, 0x70, 0x47,
0x40, 0x5C, 0x00, 0x40, 0x10, 0xB5, 0x1E, 0x4C, 0x07, 0x28, 0x18, 0xBF, 0x20, 0x70, 0x23, 0x78,
0x05, 0x2B, 0x32, 0xD8, 0xDF, 0xE8, 0x03, 0xF0, 0x03, 0x06, 0x0A, 0x0E, 0x16, 0x21, 0xFF, 0xF7,
0xE5, 0xFF, 0x2A, 0xE0, 0xFF, 0xF7, 0xE2, 0xFF, 0x04, 0x23, 0x27, 0xE0, 0x02, 0x23, 0x63, 0x70,
0x03, 0x23, 0x23, 0xE0, 0x63, 0x78, 0x01, 0x3B, 0xDB, 0xB2, 0x63, 0x70, 0x63, 0x78, 0xF3, 0xB9,
0x04, 0x22, 0x17, 0xE0, 0x0F, 0x4B, 0x1A, 0x68, 0x92, 0xB2, 0x42, 0xF0, 0x10, 0x02, 0x1A, 0x60,
0x05, 0x23, 0x23, 0x70, 0x0A, 0x23, 0x63, 0x70, 0x10, 0xBD, 0x63, 0x78, 0x01, 0x3B, 0xDB, 0xB2,
0x63, 0x70, 0x63, 0x78, 0x5B, 0xB9, 0x07, 0x4A, 0x4F, 0xF6, 0xEF, 0x73, 0x11, 0x68, 0x0B, 0x40,
0x13, 0x60, 0x06, 0x22, 0x02, 0x4B, 0x1A, 0x70, 0x10, 0xBD, 0x06, 0x23, 0x23, 0x70, 0x10, 0xBD,
0x0E, 0x03, 0x00, 0x20, 0x40, 0x5C, 0x00, 0x40, 0x06, 0x4B, 0x01, 0x22, 0x1A, 0x60, 0x06, 0x4A,
0x00, 0x20, 0x06, 0x49, 0x18, 0x60, 0x10, 0x60, 0x4F, 0xF4, 0xE0, 0x52, 0x0A, 0x80, 0x1A, 0x60,
0x70, 0x47, 0x00, 0xBF, 0x40, 0x5C, 0x00, 0x40, 0x44, 0x5C, 0x00, 0x40, 0x48, 0x03, 0x00, 0x20,
0x07, 0xB5, 0x14, 0x23, 0x8D, 0xF8, 0x04, 0x30, 0x00, 0x23, 0x8D, 0xF8, 0x05, 0x30, 0x8D, 0xF8,
0x06, 0x30, 0x01, 0xA8, 0x01, 0x23, 0x8D, 0xF8, 0x07, 0x30, 0x00, 0xF0, 0xA5, 0xF9, 0x03, 0xB0,
0x5D, 0xF8, 0x04, 0xFB, 0x10, 0xB5, 0x00, 0xF0, 0x75, 0xFA, 0x09, 0x4B, 0x00, 0x24, 0x1B, 0x68,
0x9C, 0x72, 0xFF, 0xF7, 0xD1, 0xFF, 0x07, 0x4B, 0x07, 0x4A, 0x1C, 0x60, 0x4F, 0xF4, 0x3F, 0x43,
0x13, 0x80, 0x06, 0x4A, 0x13, 0x60, 0xFF, 0xF7, 0xDB, 0xFF, 0x05, 0x4B, 0x1C, 0x60, 0x10, 0xBD,
0x44, 0x03, 0x00, 0x20, 0x44, 0x5C, 0x00, 0x40, 0x48, 0x03, 0x00, 0x20, 0x40, 0x5C, 0x00, 0x40,
0x50, 0x03, 0x00, 0x20, 0x07, 0xB5, 0x14, 0x23, 0x8D, 0xF8, 0x04, 0x30, 0x01, 0xA8, 0x00, 0x23,
0x8D, 0xF8, 0x05, 0x30, 0x8D, 0xF8, 0x06, 0x30, 0x8D, 0xF8, 0x07, 0x30, 0x00, 0xF0, 0x74, 0xF9,
0x03, 0xB0, 0x5D, 0xF8, 0x04, 0xFB, 0x00, 0x00, 0x70, 0xB5, 0x27, 0x4D, 0x27, 0x4C, 0x2B, 0x68,
0x27, 0x4E, 0x9B, 0xB2, 0x23, 0x80, 0x22, 0x88, 0x33, 0x88, 0x13, 0x40, 0x59, 0x05, 0x05, 0xD5,
0x4F, 0xF6, 0xFF, 0x33, 0x2B, 0x60, 0x23, 0x4B, 0x5B, 0x68, 0x98, 0x47, 0x22, 0x88, 0x33, 0x88,
0x1A, 0x40, 0x92, 0x04, 0x44, 0xBF, 0x4D, 0xF6, 0xFF, 0x72, 0x2A, 0x60, 0x22, 0x88, 0x13, 0x40,
0xDB, 0x04, 0x05, 0xD5, 0x4E, 0xF6, 0xFF, 0x73, 0x2B, 0x60, 0x00, 0x20, 0xFF, 0xF7, 0x42, 0xFF,
0x22, 0x88, 0x33, 0x88, 0x13, 0x40, 0x18, 0x05, 0x04, 0xD5, 0xFF, 0xF7, 0x21, 0xFF, 0x4F, 0xF2,
0xFF, 0x73, 0x2B, 0x60, 0x22, 0x88, 0x33, 0x88, 0x1A, 0x40, 0x91, 0x05, 0x07, 0xD5, 0x4F, 0xF6,
0xFF, 0x52, 0x2A, 0x60, 0x10, 0x4A, 0x11, 0x78, 0x01, 0x31, 0xC9, 0xB2, 0x11, 0x70, 0x22, 0x88,
0x13, 0x40, 0xDA, 0x05, 0x05, 0xD5, 0x4F, 0xF6, 0xFF, 0x63, 0x2B, 0x60, 0x07, 0x20, 0xFF, 0xF7,
0x21, 0xFF, 0x22, 0x88, 0x33, 0x88, 0x13, 0x40, 0x1B, 0x04, 0x03, 0xD5, 0xBD, 0xE8, 0x70, 0x40,
0x00, 0xF0, 0x7A, 0xBC, 0x70, 0xBD, 0x00, 0xBF, 0x44, 0x5C, 0x00, 0x40, 0x0C, 0x03, 0x00, 0x20,
0x48, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x4C, 0x03, 0x00, 0x20, 0x37, 0xB5, 0x01, 0x24,
0x00, 0xF0, 0x92, 0xF8, 0x00, 0xF0, 0xB4, 0xF8, 0x00, 0xF0, 0xE2, 0xF8, 0xFF, 0xF7, 0xB8, 0xFE,
0x00, 0xF0, 0xF2, 0xF8, 0x23, 0x48, 0x00, 0x94, 0x21, 0x46, 0x05, 0x22, 0x4F, 0xF4, 0xA0, 0x23,
0x00, 0xF0, 0x5A, 0xF8, 0x20, 0x48, 0x00, 0xF0, 0xF5, 0xF8, 0x28, 0xB1, 0x00, 0xF0, 0x4C, 0xF8,
0x00, 0x30, 0x18, 0xBF, 0x01, 0x20, 0x05, 0xE0, 0x1C, 0x48, 0x00, 0xF0, 0xEB, 0xF8, 0x00, 0x28,
0xF4, 0xD1, 0x20, 0x46, 0xC4, 0xB2, 0x00, 0x25, 0x05, 0x2D, 0x0E, 0xDC, 0x01, 0x21, 0x00, 0x91,
0x14, 0x48, 0x0A, 0x46, 0x4F, 0xF4, 0x80, 0x13, 0x00, 0xF0, 0x3E, 0xF8, 0x00, 0xF0, 0x98, 0xFB,
0x08, 0xB1, 0x00, 0xF0, 0x9B, 0xFB, 0x01, 0x35, 0xEE, 0xE7, 0x00, 0x2C, 0xEE, 0xD1, 0x0F, 0x48,
0x00, 0xF0, 0xD0, 0xF8, 0x08, 0xB1, 0x0D, 0x48, 0x04, 0xE0, 0x0B, 0x48, 0x00, 0xF0, 0xCA, 0xF8,
0x18, 0xB1, 0x09, 0x48, 0x00, 0xF0, 0x18, 0xF9, 0x09, 0xE0, 0x01, 0x21, 0x00, 0x91, 0x05, 0x48,
0x05, 0x22, 0x4F, 0xF4, 0xA0, 0x23, 0x00, 0xF0, 0x1F, 0xF8, 0x00, 0xF0, 0x21, 0xF9, 0x00, 0x20,
0x03, 0xB0, 0x30, 0xBD, 0x00, 0x0C, 0x01, 0x40, 0x00, 0x50, 0x00, 0x08, 0x00, 0x20, 0x00, 0x08,
0x01, 0x23, 0x03, 0xFA, 0x01, 0xF1, 0xD2, 0xF1, 0x01, 0x02, 0x38, 0xBF, 0x00, 0x22, 0x13, 0x01,
0x99, 0x40, 0x01, 0x61, 0x70, 0x47, 0x00, 0x00, 0x02, 0x4B, 0x18, 0x68, 0xC0, 0xF3, 0x00, 0x20,
0x70, 0x47, 0x00, 0xBF, 0x08, 0x0C, 0x01, 0x40, 0x2D, 0xE9, 0xF0, 0x47, 0x9D, 0xF8, 0x20, 0xA0,
0x14, 0x46, 0xCA, 0xF1, 0x01, 0x07, 0xFF, 0xB2, 0x3A, 0x46, 0x80, 0x46, 0x89, 0x46, 0x1E, 0x46,
0xFF, 0xF7, 0xDE, 0xFF, 0xB4, 0xB1, 0x35, 0x46, 0x15, 0xB1, 0x00, 0xBF, 0x01, 0x3D, 0xFB, 0xE7,
0x40, 0x46, 0x49, 0x46, 0x52, 0x46, 0xFF, 0xF7, 0xD3, 0xFF, 0x35, 0x46, 0x15, 0xB1, 0x00, 0xBF,
0x01, 0x3D, 0xFB, 0xE7, 0x40, 0x46, 0x49, 0x46, 0x3A, 0x46, 0x01, 0x3C, 0xFF, 0xF7, 0xC8, 0xFF,
0xE4, 0xB2, 0xE7, 0xE7, 0xBD, 0xE8, 0xF0, 0x87, 0x0D, 0x4B, 0x0E, 0x49, 0x1A, 0x68, 0x42, 0xF0,
0x01, 0x02, 0x1A, 0x60, 0x0C, 0x4A, 0x10, 0x68, 0x01, 0x40, 0x11, 0x60, 0x19, 0x68, 0x21, 0xF0,
0x84, 0x71, 0x21, 0xF4, 0x80, 0x31, 0x19, 0x60, 0x19, 0x68, 0x21, 0xF4, 0x80, 0x21, 0x19, 0x60,
0x13, 0x68, 0x23, 0xF4, 0xFE, 0x03, 0x13, 0x60, 0x04, 0x4B, 0x00, 0x22, 0x1A, 0x60, 0x70, 0x47,
0x00, 0x10, 0x02, 0x40, 0x00, 0x00, 0xFF, 0xF8, 0x04, 0x10, 0x02, 0x40, 0x08, 0x10, 0x02, 0x40,
0x15, 0x4B, 0x1A, 0x68, 0x42, 0xF0, 0x01, 0x12, 0x1A, 0x60, 0x1A, 0x68, 0x12, 0x48, 0x92, 0x03,
0xFB, 0xD5, 0x12, 0x4A, 0x12, 0x21, 0x11, 0x60, 0xA2, 0xF6, 0xFC, 0x72, 0x11, 0x68, 0x41, 0xF4,
0xE8, 0x11, 0x41, 0xF4, 0x80, 0x61, 0x11, 0x60, 0x01, 0x68, 0x41, 0xF0, 0x80, 0x71, 0x01, 0x60,
0x19, 0x68, 0x11, 0xF0, 0x40, 0x7F, 0xFB, 0xD0, 0x11, 0x68, 0x41, 0xF0, 0x02, 0x01, 0x11, 0x60,
0x11, 0x68, 0x09, 0x07, 0xFC, 0xD5, 0x9A, 0x69, 0x42, 0xF4, 0xFE, 0x72, 0x9A, 0x61, 0xDA, 0x69,
0x42, 0xF4, 0x00, 0x02, 0xDA, 0x61, 0x70, 0x47, 0x00, 0x10, 0x02, 0x40, 0x00, 0x20, 0x02, 0x40,
0x07, 0x4B, 0x08, 0x4A, 0x1A, 0x60, 0x4F, 0xF0, 0x80, 0x72, 0xDA, 0x60, 0x53, 0xF8, 0x04, 0x2C,
0x22, 0xF0, 0xF0, 0x02, 0x42, 0xF0, 0x10, 0x02, 0x43, 0xF8, 0x04, 0x2C, 0x70, 0x47, 0x00, 0xBF,
0x04, 0x0C, 0x01, 0x40, 0x08, 0x0C, 0x01, 0x40, 0x05, 0x4B, 0x1A, 0x68, 0xD1, 0x07, 0x03, 0xD4,
0x1A, 0x68, 0x42, 0xF0, 0x01, 0x02, 0x1A, 0x60, 0x1A, 0x68, 0x92, 0x07, 0xFC, 0xD5, 0x70, 0x47,
0x00, 0x10, 0x02, 0x40, 0x03, 0x68, 0x03, 0x48, 0x18, 0x40, 0xB0, 0xF1, 0x00, 0x53, 0x58, 0x42,
0x58, 0x41, 0x70, 0x47, 0x00, 0x00, 0xFE, 0x2F, 0x18, 0x4B, 0x30, 0xB5, 0xDB, 0x68, 0x44, 0x78,
0xDB, 0x43, 0xC3, 0xF3, 0x02, 0x23, 0xC3, 0xF1, 0x04, 0x02, 0x04, 0xFA, 0x02, 0xF2, 0x0F, 0x24,
0xDC, 0x40, 0x81, 0x78, 0x03, 0x78, 0x0C, 0x40, 0x14, 0x43, 0x03, 0xF0, 0x03, 0x01, 0xC9, 0x00,
0x24, 0x01, 0xFF, 0x22, 0x8C, 0x40, 0x8A, 0x40, 0x03, 0xF0, 0xFC, 0x03, 0x03, 0xF1, 0x60, 0x43,
0x03, 0xF5, 0x61, 0x43, 0xD3, 0xF8, 0x00, 0x53, 0x25, 0xEA, 0x02, 0x01, 0x22, 0x40, 0x0A, 0x43,
0xC3, 0xF8, 0x00, 0x23, 0x03, 0x78, 0x01, 0x22, 0x59, 0x09, 0x03, 0xF0, 0x1F, 0x03, 0x02, 0xFA,
0x03, 0xF3, 0x03, 0x4A, 0x42, 0xF8, 0x21, 0x30, 0x30, 0xBD, 0x00, 0xBF, 0x00, 0xED, 0x00, 0xE0,
0x00, 0xE1, 0x00, 0xE0, 0x07, 0x4B, 0x4F, 0xF0, 0xFF, 0x32, 0xC3, 0xF8, 0x80, 0x20, 0xC3, 0xF8,
0x84, 0x20, 0xC3, 0xF8, 0x80, 0x21, 0xC3, 0xF8, 0x84, 0x21, 0x04, 0x22, 0x43, 0xF8, 0xF0, 0x2C,
0x70, 0x47, 0x00, 0xBF, 0x00, 0xE1, 0x00, 0xE0, 0x38, 0xB5, 0x08, 0x4B, 0x80, 0x22, 0x45, 0x68,
0x04, 0x46, 0x1A, 0x60, 0xFF, 0xF7, 0x2E, 0xFE, 0xFF, 0xF7, 0xE4, 0xFF, 0xFF, 0xF7, 0x2C, 0xFF,
0x20, 0x68, 0xFF, 0xF7, 0x37, 0xFC, 0xA8, 0x47, 0x38, 0xBD, 0x00, 0xBF, 0x10, 0x20, 0x02, 0x40,
0x02, 0x4A, 0x03, 0x4B, 0xDA, 0x60, 0x00, 0xBF, 0xFD, 0xE7, 0x00, 0xBF, 0x04, 0x00, 0xFA, 0x05,
0x00, 0xED, 0x00, 0xE0, 0x0A, 0x4B, 0x10, 0xB5, 0x1A, 0x68, 0x02, 0x22, 0x1A, 0x60, 0x09, 0x4A,
0x11, 0x68, 0x14, 0x46, 0x11, 0xF0, 0x01, 0x0F, 0xF9, 0xD1, 0x90, 0x60, 0x42, 0x22, 0x1A, 0x60,
0x22, 0x68, 0x12, 0xF0, 0x01, 0x01, 0xFB, 0xD1, 0x19, 0x60, 0x01, 0x20, 0x10, 0xBD, 0x00, 0xBF,
0x10, 0x20, 0x02, 0x40, 0x0C, 0x20, 0x02, 0x40, 0x37, 0xB5, 0x8B, 0xB2, 0x00, 0x93, 0x0B, 0x0C,
0x01, 0x93, 0x0E, 0x4B, 0x01, 0x22, 0x1C, 0x68, 0x1A, 0x60, 0x0D, 0x4A, 0x15, 0x68, 0xED, 0x07,
0xFB, 0xD4, 0x01, 0x9D, 0xAD, 0xB2, 0x45, 0x80, 0x15, 0x68, 0xED, 0x07, 0xFC, 0xD4, 0x00, 0x9D,
0xAD, 0xB2, 0x05, 0x80, 0x15, 0x68, 0xED, 0x07, 0xFC, 0xD4, 0x24, 0xF0, 0x01, 0x02, 0x1A, 0x60,
0x00, 0x68, 0x43, 0x1A, 0x58, 0x42, 0x58, 0x41, 0x03, 0xB0, 0x30, 0xBD, 0x10, 0x20, 0x02, 0x40,
0x0C, 0x20, 0x02, 0x40, 0x01, 0x4B, 0x80, 0x22, 0x1A, 0x60, 0x70, 0x47, 0x10, 0x20, 0x02, 0x40,
0x03, 0x4B, 0x04, 0x4A, 0x1A, 0x60, 0x02, 0xF1, 0x88, 0x32, 0x1A, 0x60, 0x70, 0x47, 0x00, 0xBF,
0x04, 0x20, 0x02, 0x40, 0x23, 0x01, 0x67, 0x45, 0x07, 0x28, 0xC8, 0xBF, 0x08, 0x38, 0x0F, 0x23,
0x80, 0x00, 0x03, 0xFA, 0x00, 0xF0, 0xC0, 0x43, 0x70, 0x47, 0x00, 0x00, 0x02, 0x4B, 0x18, 0x88,
0x00, 0xF5, 0x00, 0x30, 0x80, 0x02, 0x70, 0x47, 0xE0, 0xF7, 0xFF, 0x1F, 0x04, 0x4B, 0x1B, 0x88,
0x81, 0x2B, 0x34, 0xBF, 0x4F, 0xF4, 0x80, 0x60, 0x4F, 0xF4, 0x00, 0x60, 0x70, 0x47, 0x00, 0xBF,
0xE0, 0xF7, 0xFF, 0x1F, 0x0D, 0x4A, 0x00, 0x23, 0x02, 0x21, 0x13, 0x70, 0x53, 0x70, 0x93, 0x70,
0xD3, 0x70, 0x11, 0x71, 0x53, 0x71, 0x0A, 0x4A, 0x0A, 0x49, 0x13, 0x60, 0x0A, 0x4A, 0x13, 0x80,
0x0A, 0x4A, 0x11, 0x60, 0x0A, 0x4A, 0x01, 0xF5, 0x88, 0x41, 0x11, 0x60, 0x09, 0x4A, 0x03, 0x21,
0x13, 0x70, 0x09, 0x4A, 0x11, 0x70, 0x09, 0x4A, 0x13, 0x70, 0x70, 0x47, 0x5D, 0x0B, 0x00, 0x20,
0x58, 0x0B, 0x00, 0x20, 0x00, 0x0C, 0x00, 0x20, 0x56, 0x0B, 0x00, 0x20, 0x04, 0x03, 0x00, 0x20,
0x00, 0x03, 0x00, 0x20, 0x5C, 0x0B, 0x00, 0x20, 0x10, 0x03, 0x00, 0x20, 0x63, 0x0B, 0x00, 0x20,
0x08, 0xB5, 0x0E, 0x4B, 0x0E, 0x48, 0x19, 0x79, 0x00, 0x22, 0xC9, 0xB2, 0x01, 0x29, 0x02, 0x60,
0x08, 0xD1, 0x02, 0x21, 0x19, 0x71, 0x1A, 0x70, 0xFF, 0xF7, 0x24, 0xFF, 0xBD, 0xE8, 0x08, 0x40,
0xFF, 0xF7, 0x36, 0xBD, 0x11, 0xF0, 0xFD, 0x0F, 0x06, 0xD0, 0x02, 0x21, 0x19, 0x71, 0x1A, 0x70,
0xBD, 0xE8, 0x08, 0x40, 0xFF, 0xF7, 0x3C, 0xBF, 0x08, 0xBD, 0x00, 0xBF, 0x5D, 0x0B, 0x00, 0x20,
0x58, 0x0B, 0x00, 0x20, 0x20, 0xB9, 0x03, 0x4B, 0x01, 0x22, 0x1B, 0x68, 0x1A, 0x82, 0x70, 0x47,
0x01, 0x48, 0x70, 0x47, 0x44, 0x03, 0x00, 0x20, 0x61, 0x0B, 0x00, 0x20, 0x20, 0xB9, 0x03, 0x4B,
0x06, 0x22, 0x1B, 0x68, 0x1A, 0x82, 0x70, 0x47, 0x01, 0x48, 0x70, 0x47, 0x44, 0x03, 0x00, 0x20,
0x5D, 0x0B, 0x00, 0x20, 0x06, 0x4B, 0x1B, 0x68, 0x30, 0xB9, 0xDA, 0x88, 0x59, 0x8A, 0x51, 0x1A,
0x19, 0x82, 0x04, 0x4B, 0x1A, 0x80, 0x70, 0x47, 0x5B, 0x8A, 0x03, 0x48, 0x18, 0x44, 0x70, 0x47,
0x44, 0x03, 0x00, 0x20, 0x56, 0x0B, 0x00, 0x20, 0x54, 0x03, 0x00, 0x20, 0x08, 0x4B, 0x30, 0xB9,
0x1B, 0x68, 0x08, 0x4A, 0x11, 0x88, 0x5A, 0x8A, 0x8A, 0x1A, 0x1A, 0x82, 0x70, 0x47, 0x06, 0x49,
0x06, 0x4A, 0x1B, 0x68, 0x12, 0x68, 0x08, 0x68, 0x5B, 0x8A, 0x10, 0x44, 0x18, 0x44, 0x70, 0x47,
0x44, 0x03, 0x00, 0x20, 0x56, 0x0B, 0x00, 0x20, 0x04, 0x03, 0x00, 0x20, 0x58, 0x0B, 0x00, 0x20,
0x70, 0xB5, 0x12, 0x4B, 0x12, 0x4E, 0x1B, 0x78, 0x34, 0x68, 0x02, 0x2B, 0x04, 0xF1, 0x00, 0x64,
0x0C, 0xBF, 0x04, 0xF5, 0xA0, 0x44, 0x04, 0xF5, 0x00, 0x54, 0x20, 0x46, 0xFF, 0xF7, 0xEA, 0xFE,
0x00, 0x25, 0x0C, 0x4B, 0x1A, 0x88, 0x92, 0xB2, 0x95, 0x42, 0x06, 0xDA, 0x0A, 0x4B, 0x60, 0x19,
0xE9, 0x58, 0xFF, 0xF7, 0xF9, 0xFE, 0x04, 0x35, 0xF3, 0xE7, 0x31, 0x68, 0x1A, 0x88, 0x92, 0xB2,
0x0A, 0x44, 0x32, 0x60, 0x00, 0x22, 0x1A, 0x80, 0x70, 0xBD, 0x00, 0xBF, 0x5C, 0x0B, 0x00, 0x20,
0x58, 0x0B, 0x00, 0x20, 0x56, 0x0B, 0x00, 0x20, 0x54, 0x03, 0x00, 0x20, 0x2D, 0xE9, 0xF0, 0x41,
0x7F, 0x49, 0x80, 0x4C, 0x01, 0x20, 0x08, 0x70, 0x23, 0x79, 0x00, 0x22, 0xDB, 0xB2, 0x02, 0x2B,
0x22, 0x70, 0x56, 0xD1, 0x08, 0x70, 0x7C, 0x49, 0x09, 0x68, 0x48, 0x78, 0x01, 0x28, 0x26, 0xD1,
0xC8, 0x88, 0x00, 0x28, 0x00, 0xF0, 0xC1, 0x80, 0x78, 0x48, 0x09, 0x7B, 0x02, 0x60, 0x01, 0x29,
0x4F, 0xF0, 0x03, 0x02, 0x22, 0x71, 0x0B, 0xD0, 0x02, 0x29, 0x16, 0xD1, 0x74, 0x4B, 0x1A, 0x70,
0x74, 0x4A, 0x75, 0x4B, 0x1A, 0x60, 0xFF, 0xF7, 0x27, 0xFE, 0xFF, 0xF7, 0xE9, 0xFE, 0xCF, 0xE0,
0x72, 0x49, 0x71, 0x4A, 0x11, 0x60, 0x6E, 0x4A, 0x13, 0x70, 0xFF, 0xF7, 0x1D, 0xFE, 0xFF, 0xF7,
0xDF, 0xFE, 0x6C, 0x48, 0xFF, 0xF7, 0x96, 0xFE, 0xC2, 0xE0, 0x0A, 0x23, 0x62, 0xE0, 0x02, 0x28,
0x21, 0xD1, 0x09, 0x23, 0x23, 0x71, 0xCA, 0x88, 0x69, 0x4B, 0x1A, 0x80, 0x18, 0x88, 0x69, 0x4A,
0x80, 0xB2, 0x10, 0x80, 0x1A, 0x88, 0x4B, 0x88, 0x92, 0xB2, 0x5A, 0x43, 0x5F, 0x4B, 0x1A, 0x60,
0x0B, 0x7B, 0x01, 0x2B, 0x03, 0xD0, 0x02, 0x2B, 0x09, 0xD1, 0x5E, 0x4A, 0x00, 0xE0, 0x5F, 0x4A,
0x5D, 0x4B, 0x1A, 0x60, 0xFF, 0xF7, 0xD2, 0xFE, 0x5F, 0x4B, 0x18, 0x60, 0xA0, 0xE0, 0x0A, 0x23,
0x23, 0x71, 0x03, 0x23, 0x9B, 0xE0, 0x06, 0x28, 0x3C, 0xD0, 0x03, 0x28, 0x19, 0xD0, 0x05, 0x28,
0x3C, 0xE0, 0x03, 0x2B, 0x0B, 0xD1, 0x50, 0x4A, 0x12, 0x68, 0x52, 0x78, 0x03, 0x2A, 0x04, 0xD1,
0x05, 0x23, 0x23, 0x71, 0xFF, 0xF7, 0x64, 0xFF, 0x8A, 0xE0, 0x05, 0x2A, 0x2E, 0xE0, 0x04, 0x2B,
0x09, 0xD1, 0x52, 0x49, 0x08, 0x78, 0x02, 0x28, 0x03, 0xD1, 0x03, 0x23, 0x62, 0x70, 0x0B, 0x70,
0x05, 0x23, 0x23, 0x71, 0x7C, 0xE0, 0x05, 0x2B, 0x14, 0xD1, 0x43, 0x4B, 0x1A, 0x68, 0x53, 0x78,
0x01, 0x2B, 0x08, 0xD1, 0xD3, 0x88, 0x0B, 0xB1, 0x03, 0x23, 0xF2, 0xE7, 0x06, 0x23, 0x23, 0x71,
0xFF, 0xF7, 0x80, 0xFE, 0x6C, 0xE0, 0x06, 0x2B, 0x4D, 0xD0, 0x03, 0x2B, 0x4B, 0xD0, 0x05, 0x2B,
0x62, 0xD1, 0x48, 0xE0, 0x06, 0x2B, 0x0B, 0xD1, 0x37, 0x49, 0x09, 0x68, 0x49, 0x78, 0x03, 0x29,
0x03, 0xD1, 0x08, 0x23, 0x23, 0x71, 0x22, 0x70, 0x5A, 0xE0, 0x05, 0x29, 0x54, 0xD1, 0xD8, 0xE7,
0x07, 0x2B, 0xF6, 0xD0, 0x08, 0x2B, 0xD4, 0xD0, 0x09, 0x2B, 0x3C, 0xD1, 0x2E, 0x4B, 0x1A, 0x68,
0x53, 0x78, 0x02, 0x2B, 0x2D, 0xD1, 0xD0, 0x88, 0x38, 0xB3, 0x31, 0x49, 0x52, 0x88, 0x0B, 0x88,
0x2D, 0x4D, 0x9B, 0xB2, 0x53, 0x43, 0x29, 0x4A, 0x2F, 0x4E, 0x13, 0x60, 0x2F, 0x68, 0xD2, 0xF8,
0x00, 0x80, 0xB1, 0xF8, 0x00, 0xC0, 0x47, 0x44, 0x33, 0x68, 0x1F, 0xFA, 0x8C, 0xFC, 0x67, 0x44,
0x9F, 0x42, 0x28, 0x4B, 0x03, 0xD8, 0x0A, 0x88, 0x92, 0xB2, 0x1A, 0x80, 0x19, 0xE0, 0x36, 0x68,
0x2D, 0x68, 0x11, 0x68, 0x72, 0x1B, 0x52, 0x1A, 0x92, 0xB2, 0x1A, 0x80, 0x1A, 0x88, 0x92, 0xB2,
0x82, 0x42, 0x08, 0xD3, 0x00, 0x22, 0x1A, 0x80, 0x05, 0xE0, 0x0A, 0x23, 0x23, 0x71, 0x09, 0x23,
0x1D, 0xE0, 0x06, 0x2B, 0x01, 0xD1, 0x02, 0x23, 0x9B, 0xE7, 0x03, 0x2B, 0x01, 0xD0, 0x05, 0x2B,
0x12, 0xD1, 0x09, 0x23, 0x95, 0xE7, 0x0A, 0x2B, 0x0E, 0xD1, 0x0F, 0x4B, 0x1B, 0x68, 0x5B, 0x78,
0x03, 0x2B, 0x01, 0xD1, 0x0A, 0x23, 0x8C, 0xE7, 0x05, 0x2B, 0xFB, 0xD0, 0x04, 0x2B, 0x03, 0xD1,
0x02, 0x23, 0x23, 0x71, 0x00, 0x23, 0x02, 0xE0, 0x0A, 0x23, 0x23, 0x71, 0x0F, 0x23, 0x23, 0x70,
0x20, 0x78, 0xD0, 0xF1, 0x01, 0x00, 0x38, 0xBF, 0x00, 0x20, 0xBD, 0xE8, 0xF0, 0x81, 0x00, 0xBF,
0x63, 0x0B, 0x00, 0x20, 0x5D, 0x0B, 0x00, 0x20, 0x44, 0x03, 0x00, 0x20, 0x58, 0x0B, 0x00, 0x20,
0x5C, 0x0B, 0x00, 0x20, 0x00, 0x20, 0x00, 0x08, 0x04, 0x03, 0x00, 0x20, 0x00, 0x50, 0x00, 0x08,
0x54, 0x0B, 0x00, 0x20, 0x56, 0x0B, 0x00, 0x20, 0x00, 0x03, 0x00, 0x20, 0x10, 0x03, 0x00, 0x20,
0x01, 0x4B, 0x18, 0x78, 0x70, 0x47, 0x00, 0xBF, 0x63, 0x0B, 0x00, 0x20, 0x00, 0xBF, 0xFD, 0xE7,
0x80, 0x00, 0x00, 0xF1, 0x80, 0x40, 0x00, 0xF5, 0xB8, 0x40, 0x03, 0x68, 0xCA, 0x06, 0x23, 0xF4,
0xE0, 0x43, 0x23, 0xF0, 0x40, 0x03, 0x9B, 0xB2, 0x48, 0xBF, 0x83, 0xF0, 0x10, 0x03, 0x8A, 0x06,
0x48, 0xBF, 0x83, 0xF0, 0x20, 0x03, 0x03, 0x60, 0x70, 0x47, 0x80, 0x00, 0x00, 0xF1, 0x80, 0x40,
0x00, 0xF5, 0xB8, 0x40, 0x03, 0x68, 0x23, 0xF4, 0x80, 0x43, 0x23, 0xF0, 0x70, 0x03, 0x9B, 0xB2,
0x83, 0xF4, 0x40, 0x53, 0x03, 0x60, 0x70, 0x47, 0x80, 0x00, 0x00, 0xF1, 0x80, 0x40, 0x00, 0xF5,
0xB8, 0x40, 0x03, 0x68, 0x23, 0xF4, 0xE2, 0x43, 0x23, 0xF0, 0x70, 0x03, 0x1B, 0x04, 0x1B, 0x0C,
0x03, 0x60, 0x70, 0x47, 0x80, 0x00, 0x00, 0xF1, 0x80, 0x40, 0x00, 0xF5, 0xB8, 0x40, 0x03, 0x68,
0x5B, 0x04, 0x06, 0xD5, 0x02, 0x68, 0x48, 0xF6, 0x8F, 0x73, 0x13, 0x40, 0x43, 0xF4, 0x80, 0x43,
0x03, 0x60, 0x70, 0x47, 0x80, 0x00, 0x00, 0xF1, 0x80, 0x40, 0x00, 0xF5, 0xB8, 0x40, 0x03, 0x68,
0x5B, 0x06, 0x06, 0xD5, 0x02, 0x68, 0x48, 0xF6, 0x8F, 0x73, 0x13, 0x40, 0x43, 0xF0, 0x40, 0x03,
0x03, 0x60, 0x70, 0x47, 0x05, 0x4B, 0x1B, 0x68, 0x9B, 0xB2, 0x03, 0xEB, 0xC0, 0x00, 0x00, 0xF1,
0x00, 0x50, 0x00, 0xF5, 0x40, 0x50, 0x40, 0x00, 0x00, 0x88, 0x70, 0x47, 0x50, 0x5C, 0x00, 0x40,
0x04, 0x4B, 0x1B, 0x68, 0x9B, 0xB2, 0x03, 0xEB, 0xC0, 0x00, 0x03, 0x4B, 0x03, 0x44, 0x5B, 0x00,
0x18, 0x88, 0x70, 0x47, 0x50, 0x5C, 0x00, 0x40, 0x04, 0x30, 0x00, 0x20, 0x04, 0x4B, 0x1B, 0x68,
0x9B, 0xB2, 0x03, 0xEB, 0xC0, 0x00, 0x03, 0x4B, 0x03, 0x44, 0x5B, 0x00, 0x19, 0x60, 0x70, 0x47,
0x50, 0x5C, 0x00, 0x40, 0x02, 0x30, 0x00, 0x20, 0x0D, 0x4B, 0x3E, 0x29, 0x1B, 0x68, 0x9B, 0xB2,
0x03, 0xEB, 0xC0, 0x00, 0x0B, 0x4B, 0x03, 0x44, 0x4F, 0xEA, 0x43, 0x02, 0x09, 0xD9, 0x4B, 0x09,
0xC8, 0x06, 0x04, 0xBF, 0x03, 0xF1, 0xFF, 0x33, 0x9B, 0xB2, 0x9B, 0x02, 0x43, 0xF4, 0x00, 0x43,
0x04, 0xE0, 0x4B, 0x08, 0xC9, 0x07, 0x48, 0xBF, 0x01, 0x33, 0x9B, 0x02, 0x13, 0x60, 0x70, 0x47,
0x50, 0x5C, 0x00, 0x40, 0x06, 0x30, 0x00, 0x20, 0x70, 0xB5, 0x4C, 0x4A, 0x4C, 0x4B, 0x11, 0x68,
0x88, 0xB2, 0x0C, 0x04, 0x18, 0x80, 0x40, 0xF1, 0x90, 0x80, 0x47, 0xF6, 0xFF, 0x71, 0x11, 0x60,
0x1A, 0x88, 0x48, 0x4C, 0x02, 0xF0, 0x0F, 0x02, 0x22, 0x70, 0x00, 0x2A, 0x5F, 0xD1, 0x46, 0x4C,
0x46, 0x4D, 0x22, 0x68, 0x46, 0x4E, 0x02, 0xF4, 0x40, 0x52, 0x2A, 0x80, 0x22, 0x68, 0x02, 0xF0,
0x30, 0x02, 0x32, 0x80, 0x22, 0x68, 0x22, 0xF4, 0x80, 0x42, 0x22, 0xF0, 0x70, 0x02, 0x92, 0xB2,
0x82, 0xF4, 0x00, 0x52, 0x22, 0x60, 0x22, 0x68, 0x22, 0xF4, 0xE0, 0x42, 0x22, 0xF0, 0x40, 0x02,
0x92, 0xB2, 0x82, 0xF0, 0x20, 0x02, 0x22, 0x60, 0x1B, 0x88, 0xD8, 0x06, 0x02, 0xD5, 0x23, 0x68,
0x19, 0x06, 0x07, 0xD5, 0x22, 0x68, 0x48, 0xF6, 0x0F, 0x73, 0x13, 0x40, 0x23, 0x60, 0x00, 0xF0,
0x61, 0xFC, 0x12, 0xE0, 0x1A, 0x05, 0x07, 0xD5, 0x22, 0x68, 0x40, 0xF6, 0x8F, 0x73, 0x13, 0x40,
0x23, 0x60, 0x00, 0xF0, 0x69, 0xFA, 0x08, 0xE0, 0x18, 0x04, 0xB6, 0xD5, 0x22, 0x68, 0x40, 0xF6,
0x8F, 0x73, 0x13, 0x40, 0x23, 0x60, 0x00, 0xF0, 0xCD, 0xFB, 0x23, 0x68, 0x2A, 0x88, 0x23, 0xF4,
0x80, 0x43, 0x23, 0xF0, 0x70, 0x03, 0x9B, 0xB2, 0xD1, 0x04, 0x48, 0xBF, 0x83, 0xF4, 0x80, 0x53,
0x95, 0x04, 0x21, 0x4A, 0x48, 0xBF, 0x83, 0xF4, 0x00, 0x53, 0x13, 0x60, 0x13, 0x68, 0x31, 0x88,
0x23, 0xF4, 0xE0, 0x43, 0x23, 0xF0, 0x40, 0x03, 0x9B, 0xB2, 0xCC, 0x06, 0x48, 0xBF, 0x83, 0xF0,
0x10, 0x03, 0x88, 0x06, 0x48, 0xBF, 0x83, 0xF0, 0x20, 0x03, 0x13, 0x60, 0x70, 0xBD, 0x93, 0x00,
0x03, 0xF1, 0x80, 0x43, 0x03, 0xF5, 0xB8, 0x43, 0x1D, 0x68, 0x29, 0x04, 0x09, 0xD5, 0x18, 0x68,
0x40, 0xF6, 0x8F, 0x71, 0x01, 0x40, 0x19, 0x60, 0x12, 0x4B, 0x01, 0x3A, 0x53, 0xF8, 0x22, 0x30,
0x98, 0x47, 0x2B, 0x06, 0x7F, 0xF5, 0x79, 0xAF, 0x21, 0x78, 0x48, 0xF6, 0x0F, 0x72, 0x8B, 0x00,
0x03, 0xF1, 0x80, 0x43, 0x03, 0xF5, 0xB8, 0x43, 0x18, 0x68, 0x01, 0x39, 0x02, 0x40, 0x1A, 0x60,
0x09, 0x4B, 0x53, 0xF8, 0x21, 0x30, 0x98, 0x47, 0x67, 0xE7, 0x70, 0xBD, 0x44, 0x5C, 0x00, 0x40,
0x0C, 0x03, 0x00, 0x20, 0x20, 0x03, 0x00, 0x20, 0x00, 0x5C, 0x00, 0x40, 0x12, 0x03, 0x00, 0x20,
0x14, 0x03, 0x00, 0x20, 0x50, 0x00, 0x00, 0x20, 0x34, 0x00, 0x00, 0x20, 0x08, 0xB5, 0x07, 0x4A,
0x07, 0x4B, 0x08, 0x49, 0x13, 0x60, 0x02, 0x22, 0x1A, 0x72, 0x07, 0x4B, 0x07, 0x4A, 0x13, 0x60,
0x07, 0x4A, 0x1B, 0x68, 0x11, 0x60, 0x98, 0x47, 0x08, 0xBD, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20,
0x24, 0x03, 0x00, 0x20, 0x6C, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x1C, 0x03, 0x00, 0x20,
0x40, 0x03, 0x00, 0x20, 0x10, 0xB5, 0x06, 0x4C, 0x18, 0xB9, 0x23, 0x68, 0x01, 0x22, 0x1A, 0x82,
0x10, 0xBD, 0x04, 0x4B, 0x1B, 0x68, 0x1B, 0x68, 0x98, 0x47, 0x20, 0x68, 0x0A, 0x30, 0x10, 0xBD,
0x44, 0x03, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x10, 0xB5, 0x06, 0x4C, 0x18, 0xB9, 0x23, 0x68,
0x01, 0x22, 0x1A, 0x82, 0x10, 0xBD, 0x04, 0x4B, 0x1B, 0x68, 0x9B, 0x68, 0x98, 0x47, 0x20, 0x68,
0x0C, 0x30, 0x10, 0xBD, 0x44, 0x03, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x10, 0xB5, 0x20, 0x4B,
0x18, 0xB9, 0x1B, 0x68, 0x02, 0x22, 0x1A, 0x82, 0x10, 0xBD, 0x1E, 0x4A, 0x19, 0x68, 0x00, 0x20,
0x10, 0x80, 0x0C, 0x78, 0x13, 0x46, 0x14, 0xF0, 0x7F, 0x04, 0x0D, 0xD1, 0x4A, 0x7A, 0x91, 0x06,
0x44, 0xBF, 0x02, 0x21, 0x19, 0x70, 0x12, 0xF0, 0x40, 0x0F, 0x1A, 0x78, 0x14, 0xBF, 0x22, 0xF0,
0x01, 0x02, 0x42, 0xF0, 0x01, 0x02, 0x14, 0xE0, 0x01, 0x2C, 0x1F, 0xD0, 0x02, 0x2C, 0x1E, 0xD1,
0x09, 0x79, 0x01, 0xF0, 0x0F, 0x02, 0x92, 0x00, 0x02, 0xF1, 0x80, 0x42, 0x02, 0xF5, 0xB8, 0x42,
0x11, 0xF0, 0x80, 0x0F, 0x12, 0x68, 0x06, 0xD0, 0x02, 0xF0, 0x30, 0x02, 0x10, 0x2A, 0x07, 0xD1,
0x01, 0x22, 0x1A, 0x70, 0x04, 0xE0, 0x02, 0xF4, 0x40, 0x52, 0xB2, 0xF5, 0x80, 0x5F, 0xF6, 0xE7,
0x05, 0x4B, 0x1B, 0x68, 0x1B, 0x69, 0x98, 0x47, 0x02, 0x48, 0x10, 0xBD, 0x10, 0x46, 0x10, 0xBD,
0x44, 0x03, 0x00, 0x20, 0x4A, 0x03, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x23, 0x4A, 0x2D, 0xE9,
0xF8, 0x43, 0x14, 0x68, 0x90, 0x46, 0x23, 0x8A, 0x26, 0x7A, 0x21, 0x4F, 0xA3, 0xB9, 0x04, 0x2E,
0x12, 0xD1, 0x20, 0x49, 0x0A, 0x78, 0x01, 0x2A, 0x0A, 0xD1, 0x1F, 0x4A, 0x10, 0x68, 0x1F, 0x4A,
0x80, 0xB2, 0x02, 0x44, 0x52, 0x00, 0x13, 0x60, 0x30, 0x22, 0x3A, 0x80, 0x0B, 0x70, 0x27, 0xE0,
0x10, 0x23, 0x3B, 0x80, 0x07, 0x26, 0x23, 0xE0, 0xA5, 0x8A, 0xAB, 0x42, 0x8C, 0xBF, 0x02, 0x26,
0x04, 0x26, 0x9D, 0x42, 0x28, 0xBF, 0x1D, 0x46, 0x28, 0x46, 0xA3, 0x69, 0x98, 0x47, 0x81, 0x46,
0x00, 0x20, 0xFF, 0xF7, 0x57, 0xFE, 0x2A, 0x46, 0x01, 0x46, 0x48, 0x46, 0x00, 0xF0, 0x68, 0xFB,
0x29, 0x46, 0x00, 0x20, 0xFF, 0xF7, 0x6A, 0xFE, 0x23, 0x8A, 0x4F, 0xF4, 0x40, 0x52, 0x5B, 0x1B,
0x23, 0x82, 0x63, 0x8A, 0x1D, 0x44, 0x30, 0x23, 0x3B, 0x80, 0x09, 0x4B, 0x65, 0x82, 0x1A, 0x80,
0xD8, 0xF8, 0x00, 0x30, 0x1E, 0x72, 0xBD, 0xE8, 0xF8, 0x83, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20,
0x14, 0x03, 0x00, 0x20, 0x64, 0x0B, 0x00, 0x20, 0x50, 0x5C, 0x00, 0x40, 0x02, 0x30, 0x00, 0x20,
0x12, 0x03, 0x00, 0x20, 0x10, 0xB5, 0x0A, 0x4B, 0x0A, 0x49, 0x1B, 0x68, 0x49, 0x78, 0x9A, 0x78,
0x91, 0x42, 0x0A, 0xD3, 0xD9, 0x78, 0x41, 0xB9, 0x9C, 0x88, 0x34, 0xB9, 0x9A, 0x72, 0x06, 0x4B,
0x1B, 0x68, 0x5B, 0x68, 0x98, 0x47, 0x20, 0x46, 0x10, 0xBD, 0x02, 0x20, 0x10, 0xBD, 0x00, 0xBF,
0x44, 0x03, 0x00, 0x20, 0x90, 0x00, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x38, 0xB5, 0x0E, 0x4A,
0x0E, 0x4C, 0x12, 0x68, 0x23, 0x68, 0x92, 0x69, 0x18, 0x79, 0x99, 0x78, 0x90, 0x47, 0x23, 0x68,
0x9A, 0x7A, 0x7A, 0xB1, 0x70, 0xB9, 0x5A, 0x79, 0x62, 0xB9, 0xDD, 0x78, 0x55, 0xB9, 0x08, 0x4B,
0x1B, 0x68, 0xDB, 0x68, 0x98, 0x47, 0x23, 0x68, 0x28, 0x46, 0x1A, 0x79, 0xDA, 0x72, 0x9A, 0x78,
0x1A, 0x73, 0x38, 0xBD, 0x02, 0x20, 0x38, 0xBD, 0x1C, 0x03, 0x00, 0x20, 0x44, 0x03, 0x00, 0x20,
0x40, 0x03, 0x00, 0x20, 0x38, 0xB5, 0x2F, 0x4B, 0x1B, 0x68, 0x18, 0x78, 0x10, 0xF0, 0x7F, 0x00,
0x04, 0xD1, 0x5A, 0x7A, 0x22, 0xF0, 0x20, 0x02, 0x5A, 0x72, 0x38, 0xBD, 0x02, 0x28, 0x4E, 0xD1,
0x5A, 0x88, 0x00, 0x2A, 0x4C, 0xD1, 0x5A, 0x79, 0x00, 0x2A, 0x49, 0xD1, 0x1A, 0x79, 0x26, 0x4D,
0x22, 0xF0, 0x80, 0x00, 0x84, 0x00, 0x04, 0xF1, 0x80, 0x41, 0x01, 0xF5, 0xB8, 0x41, 0x09, 0x68,
0x2D, 0x78, 0x12, 0xF0, 0x80, 0x0F, 0x14, 0xBF, 0x01, 0xF0, 0x30, 0x01, 0x01, 0xF4, 0x40, 0x51,
0xA8, 0x42, 0x34, 0xD2, 0x00, 0x29, 0x32, 0xD0, 0x9B, 0x7A, 0x83, 0xB3, 0x04, 0xF1, 0x80, 0x44,
0x04, 0xF5, 0xB8, 0x44, 0x12, 0x06, 0x23, 0x68, 0x0C, 0xD5, 0x03, 0xF0, 0x30, 0x03, 0x10, 0x2B,
0x1F, 0xD1, 0xC4, 0xB2, 0x20, 0x46, 0xFF, 0xF7, 0xA5, 0xFD, 0x20, 0x46, 0x30, 0x21, 0xFF, 0xF7,
0x5F, 0xFD, 0x16, 0xE0, 0x03, 0xF4, 0x40, 0x53, 0xB3, 0xF5, 0x80, 0x5F, 0x11, 0xD1, 0x28, 0xB9,
0x0E, 0x4B, 0x93, 0xF8, 0x30, 0x10, 0xFF, 0xF7, 0xCF, 0xFD, 0x01, 0xE0, 0xFF, 0xF7, 0x82, 0xFD,
0x23, 0x68, 0x23, 0xF4, 0x80, 0x43, 0x23, 0xF0, 0x70, 0x03, 0x9B, 0xB2, 0x83, 0xF4, 0x40, 0x53,
0x23, 0x60, 0x07, 0x4B, 0x1B, 0x68, 0x5B, 0x69, 0x98, 0x47, 0x00, 0x20, 0x38, 0xBD, 0x02, 0x20,
0x38, 0xBD, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20, 0x90, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
0x40, 0x03, 0x00, 0x20, 0x38, 0xB5, 0x1D, 0x4B, 0x1D, 0x4D, 0x19, 0x68, 0x2D, 0x78, 0x0A, 0x79,
0x22, 0xF0, 0x80, 0x04, 0xA3, 0x00, 0x03, 0xF1, 0x80, 0x40, 0x00, 0xF5, 0xB8, 0x40, 0x00, 0x68,
0x12, 0xF0, 0x80, 0x0F, 0x14, 0xBF, 0x00, 0xF0, 0x30, 0x00, 0x00, 0xF4, 0x40, 0x50, 0xAC, 0x42,
0x22, 0xD2, 0x4C, 0x88, 0x04, 0xBB, 0xF8, 0xB1, 0x89, 0x7A, 0xE9, 0xB1, 0x03, 0xF1, 0x80, 0x43,
0x03, 0xF5, 0xB8, 0x43, 0x12, 0xF0, 0x80, 0x0F, 0x1A, 0x68, 0x07, 0xD0, 0x22, 0xF4, 0xE0, 0x42,
0x22, 0xF0, 0x40, 0x02, 0x92, 0xB2, 0x82, 0xF0, 0x10, 0x02, 0x06, 0xE0, 0x22, 0xF4, 0x80, 0x42,
0x22, 0xF0, 0x70, 0x02, 0x92, 0xB2, 0x82, 0xF4, 0x80, 0x52, 0x1A, 0x60, 0x05, 0x4B, 0x1B, 0x68,
0x9B, 0x69, 0x98, 0x47, 0x00, 0x20, 0x38, 0xBD, 0x02, 0x20, 0x38, 0xBD, 0x44, 0x03, 0x00, 0x20,
0x90, 0x00, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x08, 0xB5, 0x06, 0x4B, 0x1B, 0x68, 0x5A, 0x7A,
0x42, 0xF0, 0x20, 0x02, 0x5A, 0x72, 0x04, 0x4B, 0x1B, 0x68, 0xDB, 0x69, 0x98, 0x47, 0x00, 0x20,
0x08, 0xBD, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x05, 0x4B, 0x1A, 0x68,
0x53, 0x8A, 0x18, 0xB9, 0x89, 0x88, 0xCB, 0x1A, 0x13, 0x82, 0x70, 0x47, 0x08, 0x68, 0x18, 0x44,
0x70, 0x47, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20, 0x08, 0xB5, 0x0B, 0x4B, 0x00, 0x20, 0x93, 0xF8,
0x30, 0x10, 0xFF, 0xF7, 0x49, 0xFD, 0x09, 0x4B, 0x1B, 0x68, 0x18, 0x7A, 0x08, 0x28, 0x06, 0xD1,
0x07, 0x4B, 0x4F, 0xF4, 0x80, 0x52, 0x1A, 0x80, 0x06, 0x4B, 0x10, 0x22, 0x1A, 0x80, 0xB0, 0xF1,
0x09, 0x03, 0x58, 0x42, 0x58, 0x41, 0x08, 0xBD, 0x00, 0x00, 0x00, 0x20, 0x44, 0x03, 0x00, 0x20,
0x12, 0x03, 0x00, 0x20, 0x14, 0x03, 0x00, 0x20, 0x73, 0xB5, 0x96, 0x4E, 0x96, 0x4B, 0x32, 0x68,
0x96, 0x4D, 0x92, 0xB2, 0x13, 0x44, 0x5B, 0x00, 0x1A, 0x68, 0x2B, 0x68, 0x19, 0x7A, 0x09, 0x29,
0x0F, 0xD0, 0x92, 0xB2, 0x52, 0x00, 0x02, 0xF1, 0x80, 0x42, 0x02, 0xF5, 0xC0, 0x42, 0x11, 0x78,
0x19, 0x70, 0x51, 0x78, 0x59, 0x70, 0x91, 0x88, 0x59, 0x80, 0x11, 0x89, 0x99, 0x80, 0x92, 0x89,
0xDA, 0x80, 0x01, 0x22, 0x1A, 0x72, 0xDA, 0x88, 0x5C, 0x78, 0x00, 0x2A, 0x61, 0xD1, 0x1A, 0x78,
0x12, 0xF0, 0x7F, 0x02, 0x3A, 0xD1, 0x09, 0x2C, 0x02, 0xD1, 0xFF, 0xF7, 0xAB, 0xFE, 0x44, 0xE0,
0x05, 0x2C, 0x0F, 0xD1, 0x93, 0xF9, 0x02, 0x20, 0x00, 0x2A, 0x01, 0xDA, 0x08, 0x23, 0x4D, 0xE0,
0xDA, 0x78, 0x00, 0x2A, 0xFA, 0xD1, 0x9A, 0x88, 0x00, 0x2A, 0xF7, 0xD1, 0x9B, 0x7A, 0x00, 0x2B,
0x37, 0xD0, 0xF3, 0xE7, 0x03, 0x2C, 0x13, 0xD1, 0x9A, 0x78, 0x01, 0x2A, 0x07, 0xD0, 0x78, 0x4B,
0x20, 0x46, 0x1B, 0x68, 0x5B, 0x69, 0x98, 0x47, 0x03, 0x28, 0x28, 0xD1, 0x35, 0xE0, 0x9A, 0x88,
0x00, 0x2A, 0xF4, 0xD1, 0x5B, 0x7A, 0x98, 0x06, 0xF1, 0xD5, 0xFF, 0xF7, 0x6D, 0xFF, 0x1C, 0xE0,
0x01, 0x2C, 0xEC, 0xD1, 0x9A, 0x78, 0x01, 0x2A, 0xE9, 0xD1, 0x9A, 0x88, 0x00, 0x2A, 0xE6, 0xD1,
0x5B, 0x7A, 0x99, 0x06, 0xE3, 0xD5, 0xFF, 0xF7, 0xB5, 0xFE, 0x0E, 0xE0, 0x01, 0x2A, 0x04, 0xD1,
0x0B, 0x2C, 0xDC, 0xD1, 0xFF, 0xF7, 0x8A, 0xFE, 0x07, 0xE0, 0x02, 0x2A, 0xD7, 0xD1, 0x01, 0x2C,
0xF1, 0xD0, 0x03, 0x2C, 0xD3, 0xD1, 0xFF, 0xF7, 0x0D, 0xFF, 0x10, 0xB1, 0xCF, 0xE7, 0x00, 0x28,
0xBC, 0xD1, 0x32, 0x68, 0x5F, 0x4B, 0x92, 0xB2, 0x13, 0x44, 0x5B, 0x00, 0x00, 0x22, 0x1A, 0x60,
0x5D, 0x4B, 0x30, 0x22, 0x1A, 0x80, 0x06, 0x23, 0x00, 0xE0, 0x09, 0x23, 0x2A, 0x68, 0x13, 0x72,
0xD4, 0xE0, 0x06, 0x2C, 0x18, 0xD1, 0x1A, 0x78, 0x52, 0x06, 0x7C, 0xD1, 0xDA, 0x78, 0x54, 0x4B,
0x01, 0x2A, 0x02, 0xD1, 0x1B, 0x68, 0xDB, 0x69, 0x6C, 0xE0, 0x02, 0x2A, 0x02, 0xD1, 0x1B, 0x68,
0x1B, 0x6A, 0x67, 0xE0, 0x03, 0x2A, 0x02, 0xD1, 0x1B, 0x68, 0x5B, 0x6A, 0x62, 0xE0, 0x21, 0x2A,
0x69, 0xD1, 0x1B, 0x68, 0x9B, 0x6A, 0x5D, 0xE0, 0x00, 0x2C, 0x3C, 0xD1, 0x59, 0x88, 0x00, 0x29,
0x61, 0xD1, 0x5A, 0x68, 0x22, 0xF0, 0xFF, 0x02, 0xB2, 0xF5, 0x00, 0x3F, 0x5B, 0xD1, 0x1A, 0x78,
0x12, 0xF0, 0x7F, 0x02, 0x04, 0xD1, 0x9B, 0x88, 0x00, 0x2B, 0x00, 0xF0, 0xAB, 0x80, 0x52, 0xE0,
0x01, 0x2A, 0x0C, 0xD1, 0x3E, 0x4A, 0x18, 0x79, 0x12, 0x68, 0x92, 0x69, 0x90, 0x47, 0x00, 0x28,
0x49, 0xD1, 0x2B, 0x68, 0x9B, 0x7A, 0x00, 0x2B, 0x40, 0xF0, 0x9C, 0x80, 0x43, 0xE0, 0x02, 0x2A,
0x41, 0xD1, 0x1B, 0x79, 0x39, 0x48, 0x03, 0xF0, 0x0F, 0x01, 0x8A, 0x00, 0x02, 0xF1, 0x80, 0x42,
0x02, 0xF5, 0xB8, 0x42, 0x12, 0x68, 0x00, 0x78, 0x13, 0xF0, 0x80, 0x0F, 0x14, 0xBF, 0x02, 0xF0,
0x30, 0x02, 0x02, 0xF4, 0x40, 0x52, 0x81, 0x42, 0x2D, 0xD2, 0x13, 0xF0, 0x70, 0x0F, 0x2A, 0xD1,
0x00, 0x2A, 0x7F, 0xD1, 0x27, 0xE0, 0x08, 0x2C, 0x03, 0xD1, 0x1B, 0x78, 0x5B, 0x06, 0x7B, 0xD0,
0x21, 0xE0, 0x0A, 0x2C, 0x1F, 0xD1, 0x1A, 0x78, 0x02, 0xF0, 0x7F, 0x02, 0x01, 0x2A, 0x1A, 0xD1,
0x9A, 0x7A, 0xC2, 0xB1, 0x59, 0x88, 0xB1, 0xB9, 0x5A, 0x68, 0x22, 0xF0, 0xFF, 0x02, 0xB2, 0xF5,
0x80, 0x3F, 0x10, 0xD1, 0x1E, 0x4A, 0x18, 0x79, 0x12, 0x68, 0x92, 0x69, 0x90, 0x47, 0x00, 0x28,
0x64, 0xD0, 0x08, 0xE0, 0x3B, 0xB1, 0x2A, 0x68, 0x00, 0x24, 0x54, 0x82, 0x93, 0x61, 0x20, 0x46,
0x98, 0x47, 0x20, 0x46, 0x0A, 0xE0, 0x16, 0x4B, 0x1A, 0x68, 0x2B, 0x68, 0x12, 0x69, 0x58, 0x78,
0x90, 0x47, 0x03, 0x28, 0x02, 0xD1, 0x11, 0x4B, 0x1B, 0x68, 0x05, 0xE0, 0x2B, 0x68, 0x4F, 0xF6,
0xFF, 0x71, 0x1A, 0x8A, 0x8A, 0x42, 0x01, 0xD1, 0x09, 0x22, 0x03, 0xE0, 0x02, 0x28, 0x00, 0xD0,
0x12, 0xB9, 0x08, 0x22, 0x1A, 0x72, 0x39, 0xE0, 0x93, 0xF9, 0x00, 0x10, 0x00, 0x29, 0x2F, 0xDA,
0xD9, 0x88, 0x01, 0x91, 0x01, 0x98, 0x82, 0x42, 0x05, 0x48, 0x11, 0xD9, 0x01, 0x9A, 0x1A, 0x82,
0x1F, 0xE0, 0x00, 0xBF, 0x50, 0x5C, 0x00, 0x40, 0x04, 0x30, 0x00, 0x20, 0x44, 0x03, 0x00, 0x20,
0x1C, 0x03, 0x00, 0x20, 0x02, 0x30, 0x00, 0x20, 0x14, 0x03, 0x00, 0x20, 0x90, 0x00, 0x00, 0x20,
0x8A, 0x42, 0x0E, 0xD2, 0x01, 0x68, 0x91, 0xF8, 0x30, 0x10, 0x8A, 0x42, 0x01, 0xD2, 0x00, 0x21,
0x05, 0xE0, 0x92, 0xFB, 0xF1, 0xF4, 0x01, 0xFB, 0x14, 0x22, 0x12, 0xB9, 0x01, 0x21, 0x0C, 0x4A,
0x11, 0x70, 0x02, 0x68, 0x92, 0xF8, 0x30, 0x20, 0x9A, 0x82, 0xFF, 0xF7, 0x2F, 0xFD, 0x05, 0xE0,
0x03, 0x22, 0x1A, 0x72, 0x07, 0x4B, 0x4F, 0xF4, 0x40, 0x52, 0x1A, 0x80, 0xFF, 0xF7, 0x84, 0xFE,
0x02, 0xB0, 0x70, 0xBD, 0x04, 0x4B, 0x9E, 0xE7, 0x04, 0x4B, 0x9C, 0xE7, 0x04, 0x4B, 0x9A, 0xE7,
0x64, 0x0B, 0x00, 0x20, 0x12, 0x03, 0x00, 0x20, 0x9D, 0x10, 0x00, 0x08, 0x55, 0x10, 0x00, 0x08,
0x79, 0x10, 0x00, 0x08, 0xF8, 0xB5, 0x2B, 0x4D, 0x2C, 0x68, 0x23, 0x7A, 0x03, 0x2B, 0x01, 0xD0,
0x05, 0x2B, 0x41, 0xD1, 0xA3, 0x69, 0x22, 0x8A, 0xAB, 0xB1, 0xA2, 0xB1, 0xA6, 0x8A, 0x96, 0x42,
0x28, 0xBF, 0x16, 0x46, 0x30, 0x46, 0x98, 0x47, 0x23, 0x8A, 0x07, 0x46, 0x9B, 0x1B, 0x23, 0x82,
0x63, 0x8A, 0x00, 0x20, 0x33, 0x44, 0x63, 0x82, 0xFF, 0xF7, 0x8A, 0xFB, 0x32, 0x46, 0x01, 0x46,
0x38, 0x46, 0x00, 0xF0, 0xA5, 0xF8, 0x23, 0x8A, 0x53, 0xB1, 0x1B, 0x4B, 0x00, 0x20, 0x4F, 0xF4,
0x40, 0x52, 0x01, 0x46, 0x1A, 0x80, 0xFF, 0xF7, 0x89, 0xFB, 0x18, 0x4B, 0x30, 0x22, 0x1A, 0x80,
0x23, 0x8A, 0xA2, 0x8A, 0x9A, 0x42, 0x02, 0xD8, 0x2B, 0x68, 0x03, 0x22, 0x02, 0xE0, 0x1B, 0xB1,
0x2B, 0x68, 0x05, 0x22, 0x1A, 0x72, 0x0C, 0xE0, 0x2A, 0x68, 0x06, 0x21, 0x11, 0x72, 0x10, 0x4A,
0x11, 0x68, 0x10, 0x4A, 0x89, 0xB2, 0x0A, 0x44, 0x52, 0x00, 0x13, 0x60, 0x0B, 0x4B, 0x30, 0x22,
0x1A, 0x80, 0x2B, 0x68, 0x1B, 0x7A, 0x06, 0xE0, 0x07, 0x2B, 0x03, 0xD1, 0x0A, 0x4B, 0x1B, 0x68,
0xDB, 0x68, 0x98, 0x47, 0x08, 0x23, 0x2A, 0x68, 0x13, 0x72, 0xBD, 0xE8, 0xF8, 0x40, 0xFF, 0xF7,
0x1B, 0xBE, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20, 0x12, 0x03, 0x00, 0x20, 0x14, 0x03, 0x00, 0x20,
0x50, 0x5C, 0x00, 0x40, 0x02, 0x30, 0x00, 0x20, 0x1C, 0x03, 0x00, 0x20, 0x30, 0xB5, 0x0B, 0x4B,
0x1C, 0x78, 0x00, 0x23, 0xA3, 0x42, 0x0C, 0xD2, 0x03, 0xF1, 0x80, 0x52, 0x02, 0xF5, 0xB8, 0x52,
0x91, 0x00, 0x0D, 0x68, 0x48, 0xF6, 0x8F, 0x72, 0x2A, 0x40, 0x1A, 0x43, 0x0A, 0x60, 0x01, 0x33,
0xF0, 0xE7, 0x03, 0x4B, 0x40, 0xF0, 0x80, 0x00, 0x18, 0x60, 0x30, 0xBD, 0x90, 0x00, 0x00, 0x20,
0x4C, 0x5C, 0x00, 0x40, 0x10, 0xB5, 0x13, 0x4C, 0x23, 0x68, 0x1A, 0x7A, 0x02, 0x2A, 0x01, 0xD0,
0x04, 0x2A, 0x04, 0xD1, 0xFF, 0xF7, 0x8A, 0xFC, 0x23, 0x68, 0x1B, 0x7A, 0x13, 0xE0, 0x06, 0x2A,
0x10, 0xD1, 0x5A, 0x78, 0x05, 0x2A, 0x09, 0xD1, 0x1A, 0x78, 0x52, 0x06, 0x06, 0xD1, 0x98, 0x78,
0xFF, 0xF7, 0xCC, 0xFF, 0x08, 0x4B, 0x1B, 0x68, 0x1B, 0x6A, 0x98, 0x47, 0x07, 0x4B, 0x1B, 0x68,
0x9B, 0x68, 0x98, 0x47, 0x08, 0x23, 0x22, 0x68, 0x13, 0x72, 0xBD, 0xE8, 0x10, 0x40, 0xFF, 0xF7,
0xCB, 0xBD, 0x00, 0xBF, 0x44, 0x03, 0x00, 0x20, 0x40, 0x03, 0x00, 0x20, 0x1C, 0x03, 0x00, 0x20,
0x30, 0xB5, 0x01, 0xF1, 0x00, 0x51, 0x01, 0x32, 0x01, 0xF5, 0x40, 0x51, 0x52, 0x10, 0x49, 0x00,
0x00, 0x23, 0x93, 0x42, 0x00, 0xF1, 0x02, 0x00, 0x09, 0xD0, 0x10, 0xF8, 0x01, 0x5C, 0x10, 0xF8,
0x02, 0x4C, 0x44, 0xEA, 0x05, 0x24, 0x21, 0xF8, 0x23, 0x40, 0x01, 0x33, 0xF1, 0xE7, 0x30, 0xBD,
0x10, 0xB5, 0x01, 0xF1, 0x00, 0x51, 0x01, 0x32, 0x01, 0xF5, 0x40, 0x51, 0x52, 0x10, 0x49, 0x00,
0x00, 0x23, 0x93, 0x42, 0x05, 0xD0, 0x51, 0xF8, 0x23, 0x40, 0x20, 0xF8, 0x13, 0x40, 0x01, 0x33,
0xF7, 0xE7, 0x10, 0xBD, 0xD5, 0x04, 0x00, 0x08, 0xFD, 0x01, 0x00, 0x08, 0xBB, 0x01, 0x00, 0x08,
0xBD, 0x01, 0x00, 0x08, 0xA5, 0x02, 0x00, 0x08, 0x49, 0x03, 0x00, 0x08, 0xBF, 0x01, 0x00, 0x08,
0x05, 0x03, 0x00, 0x08, 0x11, 0x03, 0x00, 0x08, 0x1D, 0x03, 0x00, 0x08, 0x3D, 0x03, 0x00, 0x08,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08,
0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08,
0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08,
0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08, 0xB9, 0x01, 0x00, 0x08,
0xC9, 0x01, 0x00, 0x08, 0xCD, 0x01, 0x00, 0x08, 0xE5, 0x01, 0x00, 0x08, 0xE7, 0x01, 0x00, 0x08,
0xE9, 0x01, 0x00, 0x08, 0xEB, 0x01, 0x00, 0x08, 0xED, 0x01, 0x00, 0x08, 0xEF, 0x01, 0x00, 0x08,
0xF1, 0x01, 0x00, 0x08, 0x01, 0x01, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00,
0x32, 0x01, 0x00, 0x20, 0x12, 0x00, 0x00, 0x00, 0x4C, 0x01, 0x00, 0x20, 0x14, 0x00, 0x00, 0x00,
0x19, 0x01, 0x00, 0x20, 0x10, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x20, 0x8E, 0x00, 0x00, 0x00,
0xEE, 0x01, 0x00, 0x20, 0x84, 0x00, 0x00, 0x00, 0x72, 0x02, 0x00, 0x20, 0x84, 0x00, 0x00, 0x00,
0x12, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0xAF, 0x1E, 0x03, 0x00, 0x01, 0x02, 0x01, 0x02,
0x03, 0x01, 0x00, 0x00, 0x29, 0x01, 0x00, 0x20, 0x09, 0x00, 0x00, 0x00, 0x04, 0x03, 0x09, 0x04,
0x09, 0x02, 0x2D, 0x00, 0x01, 0x01, 0x00, 0x80, 0x32, 0x09, 0x04, 0x00, 0x00, 0x00, 0xFE, 0x01,
0x02, 0x04, 0x09, 0x04, 0x00, 0x01, 0x00, 0xFE, 0x01, 0x02, 0x05, 0x09, 0x04, 0x00, 0x02, 0x00,
0xFE, 0x01, 0x02, 0x06, 0x09, 0x21, 0x03, 0xFF, 0x00, 0x00, 0x08, 0x10, 0x01, 0x10, 0x03, 0x4C,
0x00, 0x4C, 0x00, 0x4D, 0x00, 0x20, 0x00, 0x30, 0x00, 0x30, 0x00, 0x33, 0x00, 0x09, 0x21, 0x03,
0xFF, 0x00, 0x00, 0x08, 0x10, 0x01, 0x12, 0x03, 0x4C, 0x00, 0x65, 0x00, 0x61, 0x00, 0x66, 0x00,
0x4C, 0x00, 0x61, 0x00, 0x62, 0x00, 0x73, 0x00, 0xCC, 0x00, 0x00, 0x20, 0x12, 0x00, 0x00, 0x00,
0x14, 0x03, 0x4D, 0x00, 0x61, 0x00, 0x70, 0x00, 0x6C, 0x00, 0x65, 0x00, 0x20, 0x00, 0x30, 0x00,
0x30, 0x00, 0x33, 0x00, 0x8E, 0x03, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x6C, 0x00,
0x6F, 0x00, 0x61, 0x00, 0x64, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x32, 0x00, 0x2E, 0x00,
0x30, 0x00, 0x2E, 0x00, 0x72, 0x00, 0x63, 0x00, 0x31, 0x00, 0x20, 0x00, 0x45, 0x00, 0x52, 0x00,
0x52, 0x00, 0x4F, 0x00, 0x52, 0x00, 0x2E, 0x00, 0x20, 0x00, 0x55, 0x00, 0x70, 0x00, 0x6C, 0x00,
0x6F, 0x00, 0x61, 0x00, 0x64, 0x00, 0x20, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x20, 0x00, 0x52, 0x00,
0x41, 0x00, 0x4D, 0x00, 0x20, 0x00, 0x69, 0x00, 0x73, 0x00, 0x20, 0x00, 0x6E, 0x00, 0x6F, 0x00,
0x74, 0x00, 0x20, 0x00, 0x73, 0x00, 0x75, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6F, 0x00, 0x72, 0x00,
0x74, 0x00, 0x65, 0x00, 0x64, 0x00, 0x2E, 0x00, 0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x61, 0x00,
0x70, 0x00, 0x6C, 0x00, 0x65, 0x00, 0x2D, 0x00, 0x6D, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x69, 0x00,
0x29, 0x00, 0x84, 0x03, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x6C, 0x00, 0x6F, 0x00,
0x61, 0x00, 0x64, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x32, 0x00, 0x2E, 0x00, 0x30, 0x00,
0x2E, 0x00, 0x72, 0x00, 0x63, 0x00, 0x31, 0x00, 0x20, 0x00, 0x55, 0x00, 0x70, 0x00, 0x6C, 0x00,
0x6F, 0x00, 0x61, 0x00, 0x64, 0x00, 0x20, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x20, 0x00, 0x46, 0x00,
0x6C, 0x00, 0x61, 0x00, 0x73, 0x00, 0x68, 0x00, 0x20, 0x00, 0x61, 0x00, 0x64, 0x00, 0x64, 0x00,
0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x20, 0x00, 0x30, 0x00, 0x78, 0x00, 0x38, 0x00,
0x30, 0x00, 0x30, 0x00, 0x35, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x20, 0x00, 0x28, 0x00,
0x4D, 0x00, 0x61, 0x00, 0x70, 0x00, 0x6C, 0x00, 0x65, 0x00, 0x2D, 0x00, 0x6D, 0x00, 0x69, 0x00,
0x6E, 0x00, 0x69, 0x00, 0x29, 0x00, 0x84, 0x03, 0x42, 0x00, 0x6F, 0x00, 0x6F, 0x00, 0x74, 0x00,
0x6C, 0x00, 0x6F, 0x00, 0x61, 0x00, 0x64, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x32, 0x00,
0x2E, 0x00, 0x30, 0x00, 0x2E, 0x00, 0x72, 0x00, 0x63, 0x00, 0x31, 0x00, 0x20, 0x00, 0x55, 0x00,
0x70, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x61, 0x00, 0x64, 0x00, 0x20, 0x00, 0x74, 0x00, 0x6F, 0x00,
0x20, 0x00, 0x46, 0x00, 0x6C, 0x00, 0x61, 0x00, 0x73, 0x00, 0x68, 0x00, 0x20, 0x00, 0x61, 0x00,
0x64, 0x00, 0x64, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x20, 0x00, 0x30, 0x00,
0x78, 0x00, 0x38, 0x00, 0x30, 0x00, 0x30, 0x00, 0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
0x20, 0x00, 0x28, 0x00, 0x4D, 0x00, 0x61, 0x00, 0x70, 0x00, 0x6C, 0x00, 0x65, 0x00, 0x2D, 0x00,
0x6D, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x69, 0x00, 0x29, 0x00, 0x00, 0x00, 0xEC, 0x00, 0x00, 0x20,
0x2D, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x20, 0x00, 0x0C, 0x00, 0x20
};
#define BOARD_LED_PIN 33
typedef struct {
volatile uint32 CR;
volatile uint32 CFGR;
volatile uint32 CIR;
volatile uint32 APB2RSTR;
volatile uint32 APB1RSTR;
volatile uint32 AHBENR;
volatile uint32 APB2ENR;
volatile uint32 APB1ENR;
volatile uint32 BDCR;
volatile uint32 CSR;
} RCC_RegStruct;
typedef enum { RESET = 0, SET = !RESET } FlagStatus, ITStatus;
typedef enum { DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
typedef enum { ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
#define BOOTLOADER_FLASH ((uint32)0x08000000)
#define PAGE_SIZE 1024
#define SET_REG(addr,val) do { *(volatile uint32*)(addr)=val; } while(0)
#define GET_REG(addr) (*(volatile uint32*)(addr))
#define RCC ((uint32)0x40021000)
#define FLASH ((uint32)0x40022000)
#define RCC_CR RCC
#define RCC_CFGR (RCC + 0x04)
#define RCC_CIR (RCC + 0x08)
#define RCC_AHBENR (RCC + 0x14)
#define RCC_APB2ENR (RCC + 0x18)
#define RCC_APB1ENR (RCC + 0x1C)
#define FLASH_ACR (FLASH + 0x00)
#define FLASH_KEYR (FLASH + 0x04)
#define FLASH_OPTKEYR (FLASH + 0x08)
#define FLASH_SR (FLASH + 0x0C)
#define FLASH_CR (FLASH + 0x10)
#define FLASH_AR (FLASH + 0x14)
#define FLASH_OBR (FLASH + 0x1C)
#define FLASH_WRPR (FLASH + 0x20)
#define FLASH_KEY1 0x45670123
#define FLASH_KEY2 0xCDEF89AB
#define FLASH_RDPRT 0x00A5
#define FLASH_SR_BSY 0x01
#define FLASH_CR_PER 0x02
#define FLASH_CR_PG 0x01
#define FLASH_CR_START 0x40
#define pRCC ((RCC_RegStruct *) RCC)
bool flashErasePage(uint32 pageAddr) {
uint32 rwmVal = GET_REG(FLASH_CR);
rwmVal = FLASH_CR_PER;
SET_REG(FLASH_CR, rwmVal);
while (GET_REG(FLASH_SR) & FLASH_SR_BSY) {}
SET_REG(FLASH_AR, pageAddr);
SET_REG(FLASH_CR, FLASH_CR_START | FLASH_CR_PER);
while (GET_REG(FLASH_SR) & FLASH_SR_BSY) {}
/* todo: verify the page was erased */
rwmVal = 0x00;
SET_REG(FLASH_CR, rwmVal);
return true;
}
bool flashErasePages(uint32 pageAddr, uint16 n) {
while (n-- > 0) {
if (!flashErasePage(pageAddr + 0x400 * n)) {
return false;
}
}
return true;
}
bool flashWriteWord(uint32 addr, uint32 word) {
volatile uint16 *flashAddr = (volatile uint16 *)addr;
volatile uint32 lhWord = (volatile uint32)word & 0x0000FFFF;
volatile uint32 hhWord = ((volatile uint32)word & 0xFFFF0000) >> 16;
uint32 rwmVal = GET_REG(FLASH_CR);
SET_REG(FLASH_CR, FLASH_CR_PG);
/* apparently we need not write to FLASH_AR and can
simply do a native write of a half word */
while (GET_REG(FLASH_SR) & FLASH_SR_BSY) {}
*(flashAddr + 0x01) = (volatile uint16)hhWord;
while (GET_REG(FLASH_SR) & FLASH_SR_BSY) {}
*(flashAddr) = (volatile uint16)lhWord;
while (GET_REG(FLASH_SR) & FLASH_SR_BSY) {}
rwmVal &= 0xFFFFFFFE;
SET_REG(FLASH_CR, rwmVal);
/* verify the write */
if (*(volatile uint32 *)addr != word) {
return false;
}
return true;
}
void flashLock() {
/* take down the HSI oscillator? it may be in use elsewhere */
/* ensure all FPEC functions disabled and lock the FPEC */
SET_REG(FLASH_CR, 0x00000080);
}
void flashUnlock() {
/* unlock the flash */
SET_REG(FLASH_KEYR, FLASH_KEY1);
SET_REG(FLASH_KEYR, FLASH_KEY2);
}
/* Minimum_Source*/
void setupFLASH() {
/* configure the HSI oscillator */
if ((pRCC->CR & 0x01) == 0x00) {
uint32 rwmVal = pRCC->CR;
rwmVal |= 0x01;
pRCC->CR = rwmVal;
}
/* wait for it to come on */
while ((pRCC->CR & 0x02) == 0x00) {}
}
bool writeChunk(uint32 *ptr, int size, const char *data)
{
flashErasePage((uint32)(ptr));
for (int i = 0; i < size; i = i + 4) {
if (!flashWriteWord((uint32)(ptr++), *((uint32 *)(data + i)))) {
return false;
}
}
return true;
}
bool isNewBootloaderAlreadyInstalled()
{
char *existingBootloader = (char *) BOOTLOADER_FLASH;
int bootloaderSize=sizeof(maple_mini_boot20);
for(int i=0;i<bootloaderSize;i++)
{
if ( maple_mini_boot20[i]!= *(existingBootloader+i))
{
return false;
}
}
return true;
}
void setup()
{
char * bootloader = const_cast<char *>(maple_mini_boot20);
int n = 0;
bool alreadyInstalled = isNewBootloaderAlreadyInstalled();
pinMode(BOARD_LED_PIN, OUTPUT);
Serial.begin(9600);
// Wait for the user to open the serial window.
while (!(Serial.isConnected() && (Serial.getDTR() )))
{
digitalWrite(BOARD_LED_PIN, !digitalRead(BOARD_LED_PIN));
delay(1000); // Slow blink
}
if (alreadyInstalled)
{
Serial.print("Congratulations. You have already updated to this version of the bootloader");
while(1);
}
digitalWrite(BOARD_LED_PIN, LOW);
Serial.println ("**************************************************************************************************");
Serial.println ("*** This sketch will update the bootloader in the Maple Mini to the STM32duino bootloader ****");
Serial.println ("*** With this you can use up to 120KB of Flash and 20KB of RAM for a Sketch ****");
Serial.println ("*** Uploading is also considerably faster on OSX (and possibly faster on Linux) ****");
Serial.println ("*** ****");
Serial.println ("*** Only use with Maple mini boards ****");
Serial.println ("*** ****");
Serial.println ("*** WARNING. If the update fails your Maple mini may not have a functional bootloder. ****");
Serial.println ("*** ****");
Serial.println ("*** YOU UPDATE AT YOUR OWN RISK ****");
Serial.println ("*** ****");
Serial.println ("*** ****");
Serial.println ("*** ****");
Serial.println ("*** ****");
Serial.println ("**************************************************************************************************");
Serial.println ("*** ****");
Serial.println ("*** ****");
Serial.println ("*** To confirm and proceed, enter Y ****");
Serial.println ("*** ****");
while (Serial.read() != 'Y')
{
delay(1);
}
Serial.println ("*** ****");
n = sizeof(maple_mini_boot20);
setupFLASH();
flashUnlock();
int success = 1;
int pages = n/PAGE_SIZE;
int currentPage=1;
for (int i = 0; i < n; i += PAGE_SIZE)
{
int size = 0;
uint32* chunk = (uint32 *)(BOOTLOADER_FLASH + i);
size = n - i;
if (size > PAGE_SIZE)
{
size = PAGE_SIZE;
}
if (!writeChunk(chunk, size, &bootloader[i]))
{
Serial.println ();
Serial.println ("WARNING, Update Failed!! The sketch will restart in 3 seconds and you can try to flash again");
delay (3000);
success = 0;
break;
}
Serial.print("Writing flash page ");Serial.print(currentPage++);Serial.print(" of ");Serial.println(pages+1);
}
if (success)
{
flashLock();
Serial.println ();
Serial.println ("Update completed successfully. - Please test by uploading a different sketch");
while (1) {
digitalWrite(BOARD_LED_PIN, LOW);
delay(500);
digitalWrite(BOARD_LED_PIN, HIGH);
delay(500);
}
}
}
void loop(){}
I’ve taken Ray’s version and combined it into one file and included the bootloader data inside the sketch so that its self contained.
I used the version that Ray uploaded as it had all the files in the zip, and was easier to get to work before i started to hack it.
I think some of the code could do with cleaning up, as the for loop that calls the chunk writing code, looks unnecessarily complicated, and seems to have a mixture of pointers and array indexing.
But it does work as it stands, and its quite time consuming to modify and test, especially if i keep having to reflash back to the original maple mini bootloader ( from leaflabs) using a usb to serial adaptor, just to confirm it will update from the old bootloader.
I think my time is probably better spent on helping people install the generic bootloader using a Uno as a programmer. it would be great if we could write an AVR sketch that could act like stm32flash.exe and communicate directly with the STM32 is on board serial bootloader.
It may just be possible to squeeze it into a Uno.
I’ve taken Ray’s version and combined it into one file and included the bootloader data inside the sketch so that its self contained.
I’ve cleaned up the messages and the comments etc
I’ve tested on an original a Maple mini running the original maple bootloader (downloaded from leaflabs site), and also with updating its self !
Edit.
I’ve just updated the code a bit, so it verifies if the version of the bootloader it had installed is the version in the sketch.
If so, it displays a message and stops.
I reworked the code a lot.
Its all in setup() now, as I couldn’t seem any point in it being in loop() as it only runs once.
It seems quite stable and several people have used it to update. So I should put the file into my repo , possibly in the binaries folder
TIA,
Aram
TIA,
Aram
Please try using that version.
I updated by Mac to 1.6.9 and it worked fine, albeit I had 1.6.5 working on the Mac already.
And I have Dfu-util installed via Homebrew

