Porting TinyCLROS to STM32F205RG


So with the latest release of TinyCLR OS I am seeing that there is support for the Cortex-M3 chips and I am going to try to do my first porting. My questions, can this be done on STM32F2x5 chips, specifically the STM32F205RG chip and what do I need in addition to the porting docs?

In my collection, I came across these two boards, Adafruit WICED WiFi Feather and a RedBear Duo each sporting the above mentioned chip. I able to attached the Adafruit Wiced board with the ST-Link/V2 and but not the Redbear Duo running custom Particle.io firmware. I would love to be able to put TinyCLR on these, but getting the port done is the first priority.

STM32F4 should be very similar to STM32F2. You need to use M3 instead of M4, which we include both.

So take the FEZCLR port and change M4 with M3, and you have completed 95% of the work.

We look forward to seeing your pull request :slight_smile:

So, I am here asking for some additional insight on the whole porting process. As mentioned I am trying to port to the STM32F205RG chip used in the Redbear Duo and the Adafruit WICED products. So far using a ST-Link V2 device I am able to successfully erase the flash the STM32 ST-Link Utility.

I started my porting by copying the Clicker port and using it as a starting point, my folder RedbearDuo. I then modify the following lines in the device.h:

STM32F4_AHB_CLOCK_HZ 120000000
STM32F4_APB1_CLOCK_HZ 60000000
STM32F4_APB2_CLOCK_HZ 12000000

I then run the build.bat specifying my folder, this outputs a .bin and a .hex file. Using the STM32 ST-LINK Utility, I uploaded the .bin with 0x08040000 as the starting address, if I upload the .hex it automatically set the address 0x08000000. After a successful upload, I remove the ST LINK V2 device plug in a USB cable and what do you know, nothing happens. Does not matter which file or combination I upload, nothing, and PC does not see the chip.

What could I be doing wrong or could be missing?

I’d double check the address the image is meant to run from. If there’s no other bootloaders or program in flash, ST devices usually boot from 0x08000000, so make sure that the linkerscript and device.h all reflect that fact, not 0x08040000.

You may have better luck using serial as the debug interface to get started instead of USB, it’s a pretty complicated peripheral.

The specific chip you’re using is a CortexM3 while the Clicker uses the STM32F415RG, a CortexM4. At the very least you’ll need to change your port’s build to use the M3 library, not M4. You’ll also want to update the device define and acquire and use the STM32F2 headers, not the F4 headers.

Thanks John