AngusMcDoon
Well-Known Member
Yet Another Pontless Project (upgrade)
Previously, the YAPP AIS plotter was running on a 18F PIC processor, here. Now this all worked in a PIC sort of way, but it was pushing the boundaries of PICness, especially all the floating point geometry and driving the QVGA display. I was also getting scoffed at by the big important people here for using a feeble boy's processor. So now I have pushed myself through the initial ARM pain barrier, and here is the first YAPP running on an STM32F100 ARM M3 Cortex jobbie...
The processor board is an STM32VL-Discovery from ST. It's sold by Farnell for about a tenner and includes an ST-Link JTAG on the board, so no extra hardware needed to flash and debug. All the development environment is legally free. I use the CooCox IDE and the free GNU ARM compiler. I did try using plain vanilla Eclipse, the Code Sourcery compiler, and OpenOCD for debugging. That all worked too eventually, but was especially painful to get going.
<geekspeak>
Porting the code was the normal world of grief, as porting embedded code always is. One particular gotcha that held me up was plain 'char' on the PIC compiler is signed, but on the ARM compiler it is unsigned. This is because, as I found out, the C standard does not specify the signedness of plain chars. I ended up comparing what I thought were 2 signed chars, but in fact were signed/unsigned, the optimiser said 'that will always be false' and took a chunck of code out. Consequently I was dereferencing memory that didn't exist which gave an immediate hard fault with no call stack.
</geekspeak>
Now so far, it does just the same as the previous PIC based version, so it's not a new YAPP, just a YAPP(u) upgrade...
I still have code and memory space left over out of my 128k/8k. I have got the SD card interface working and I can write to a FAT32 file system on the card. I thought about writing AIS details of everything that goes past, so later back in the office in the dark days of winter you can replay your voyages at high speed and remember those sunny summer days of June 2012.
A final reason for moving YAPPs to ARM is that I get lots of people who say they would like to have a go but don't want to do all the spaghetti wiring. Now from the first picture it can be seen that there is still alot of wiring up to do - that display card has 40 connections. But now I have it running on an STM32, it should not be too difficult to port it to my next hardware platform, which is a pre-built STM32 board with lots of integrated goodies, including the display, serial line drivers, USB, beepers, SD card reader etc. Here's one I have just bought...
These cost £28, and can be flashed with nothing more than a USB cable and some free software from ST. Dedicated followers of YAPP will then be able to have their own pointless devices with no fiddly wiring at all.
Sauce code (at the moment working on the STM32VL-Discovery board) to anyone who wants it. PM me an email address. I've not done a schematic for this one yet, but I'll knock up something if anyone wants it.
Previously, the YAPP AIS plotter was running on a 18F PIC processor, here. Now this all worked in a PIC sort of way, but it was pushing the boundaries of PICness, especially all the floating point geometry and driving the QVGA display. I was also getting scoffed at by the big important people here for using a feeble boy's processor. So now I have pushed myself through the initial ARM pain barrier, and here is the first YAPP running on an STM32F100 ARM M3 Cortex jobbie...
The processor board is an STM32VL-Discovery from ST. It's sold by Farnell for about a tenner and includes an ST-Link JTAG on the board, so no extra hardware needed to flash and debug. All the development environment is legally free. I use the CooCox IDE and the free GNU ARM compiler. I did try using plain vanilla Eclipse, the Code Sourcery compiler, and OpenOCD for debugging. That all worked too eventually, but was especially painful to get going.
<geekspeak>
Porting the code was the normal world of grief, as porting embedded code always is. One particular gotcha that held me up was plain 'char' on the PIC compiler is signed, but on the ARM compiler it is unsigned. This is because, as I found out, the C standard does not specify the signedness of plain chars. I ended up comparing what I thought were 2 signed chars, but in fact were signed/unsigned, the optimiser said 'that will always be false' and took a chunck of code out. Consequently I was dereferencing memory that didn't exist which gave an immediate hard fault with no call stack.
</geekspeak>
Now so far, it does just the same as the previous PIC based version, so it's not a new YAPP, just a YAPP(u) upgrade...
I still have code and memory space left over out of my 128k/8k. I have got the SD card interface working and I can write to a FAT32 file system on the card. I thought about writing AIS details of everything that goes past, so later back in the office in the dark days of winter you can replay your voyages at high speed and remember those sunny summer days of June 2012.
A final reason for moving YAPPs to ARM is that I get lots of people who say they would like to have a go but don't want to do all the spaghetti wiring. Now from the first picture it can be seen that there is still alot of wiring up to do - that display card has 40 connections. But now I have it running on an STM32, it should not be too difficult to port it to my next hardware platform, which is a pre-built STM32 board with lots of integrated goodies, including the display, serial line drivers, USB, beepers, SD card reader etc. Here's one I have just bought...
These cost £28, and can be flashed with nothing more than a USB cable and some free software from ST. Dedicated followers of YAPP will then be able to have their own pointless devices with no fiddly wiring at all.
Sauce code (at the moment working on the STM32VL-Discovery board) to anyone who wants it. PM me an email address. I've not done a schematic for this one yet, but I'll knock up something if anyone wants it.