based on this page, it looks like this is similar enough to the ZE used on the native for this to be very straightforward, if a little time consuming.
the good news is that once you've done this once, you get a solid understanding of how everything in libmaple fits together, and adding new MCUs/boards becomes a trivial matter.
to get libmaple proper working, you should only need to add the appropriate MCU config to stm32.h. that is, the only thing you should need to do for libmaple proper is add an #elif defined(MCU_STM32F103VET6)
section around here in stm32.h. you can imitate the sections for the other MCUs, above.
in order to get more complete support going with our Makefile, you'll need to pick a new BOARD name (i.e., compile libmaple with BOARD=yourboardname
), and:
1. modify support/make/target-config.mk for your BOARD. use the maple native parts as a starting point. the error LED stuff is for throb() in util.c. if you don't define those, then everything will still work, but the LED won't throb on assertion failures, etc., which can make debugging harder.
2. add a new yourboard.h and yourboard.cpp to wirish/boards/. maple.h and maple.cpp have the best comments about what's going on in those files, while maple_native.h and maple_native.cpp are probably the closest to what you're doing. you can read the board-specific values documentation for more info on what goes into the header file.
3. add an include for yourboard.h appropriately around here in wirish/boards.h.
4. add linker scripts for your board to support/ld/yourboardname/<flash,ram,jtag>.ld. don't panic if you've never written a linker script; you mostly just need to configure memory. see the existing board linker scripts in the subdirectories under e.g. support/ld/maple_RET6/ for examples. since the maple bootloader has not been ported to the VET6, your best bet is probably just to define a jtag.ld, which is meant for "bare metal" (i.e., no bootloader) builds. you'll need a JTAG programmer for this to work, of course.
i started a wiki page with some information on porting libmaple a while back:
http://wiki.leaflabs.com/index.php?title=Porting_libmaple
it could definitely use some more love. i'll start by adding the information in this post to that page. if you succeed in your port, please add any extra information you found useful to the wiki, so that future porters have an easier time.
hope this helps, and happy hacking!
edit: typos, added boards.h info
Update: see this commit in torfbolt's libmaple tree for an example:
https://github.com/torfbolt/libmaple/commit/24d632323be65ecbd2d636854367f8ab73f7e576
That patch is for the STM32F103RBT6 (like what's used on the Maple), so they had less work to do, as there wasn't a new MCU being added, but it should give you a starting point.