Updates of the project:
- SmartFusion A2F200 and OpenOCD
After preparing the patch to OpenOCD to support writing in the flash memory, we sent the patch. It was refused due the amount of code from Actel we used to generate the embedded bin program. We could provide a cleaner code, removing the unused things from Actel’s driver, but it is working and we don’t have much time, after Rose we can work more in the patch.
If you are still interested in this patch you can found it here. Or send us an email .
Our PCB has arrived! \o/ Seems that we are going to weld the components tomorrow
- Libero (FPGA and project configuration)
The routing of FPGA is done, a map between MSS ans FPGA, which are the things that can be connected directly with a GPIO and which can not. So after we have our robot, we will be able to drive the peripherals which doesn’t need a complex FPGA support.
Necessary HDL modules will be done together with the peripheral’s drive.
We integrated FreeRTOS to our project. There is just some minor things we need to configure, as the code work in the Ram but doesn’t in Rom memory =/
SPI driver is done and tested for SmartFusion Evaluation Board, we will need to adjust some aspects of the drive to our SPI flash memory
After the OpenoCD patch, we tested DirectC in flash it is working but it is not fully integrated with the project. Tomorrow we hope to have the FPGA programing environment working and tested with our Robot.
More updates tomorrow.
This weekend me and Helen worked more on the OpenOCD’s patch to write in the SmartFusion eNVM flash. We finally got it working, now we can load and execute code in flash \o/. Helen is now making some adjustments and organizing the git tree so we can commit it to OpenOCD.
We used Actel’s eNVM driver to create a stub that OpenOCD places in RAM and uses to perform the writing. The stub is compiled, the elf is converted into a binary image which is converted to a char array that is included in the OpenOCD source. After that, we wrote a OpenOCD flash driver for SmartFusion. A OpenOCD flash driver demands certain functions to be implemented, but as we’re in quite a hurry, we minimally implemented only the ones we needed: probe and write. The probe function initializes information that OpenOCD has on the flash bank. We saw in other drivers that it usually does more things, but we implemented only the basic to allow the write function to work. The write function places the stub in RAM, then repeatedly places a part of the image in RAM and runs the stub to write them to flash.
I’ll now move to creating the Libero project for our robot. Libero is the Actel’s development plataform for SmartFusion, and we need to use it to redirect the GPIOs to the FPGA pads. For now, it will generate a FPGA image that contains only this routing of GPIO to pads. Latter, as we work on the app libraries, we will insert the modules to control the motors, LCD, and other peripherals. Then we will use it to generate the final FPGA image that we will load into the Tutobot.
Yesterday we got our PCB soldered, next step is obviously to test it. First happy thing was that the board didn’t get on fire when powering it on.
We created a new ChibiOS project that will be the base for our code. To do things the proper way, we also made a new board folder, which is specific to our PCB. It specifies all the settings of the various GPIOs on the µC, such as the alternate functions.
One minor problem we hit, is that stm32f4 isn’t supported in the openocd build that is running on lab’s desktops, so we had to build master branch of openocd’s git. Thanks to Sam, that was an easy task. After that, the JTAG just worked out of the box.
Once everything was setup, first functions we’ve tested is powering on/off the red led, and the serial port. Testing them made us realize that the serial port has actually been wired the wrong way, TX on the usual RX pin of the micromatch. Hopefully, we aren’t the only group to have failed on that, so we can use SaMoRa’s serial cable .
Another mistake on the schematics we found out, is that one encoder plug isn’t properly usable: one pin is on a timer, while the other one is on another timer. This is no big problem, since it can easily be done in software, and that it seems really unlikely we’ll use encoder.
Yet another mistake on the PCB, is that the plugs aren’t named, so we need a map to know what function is on what plug.
Anyway, despite the various problems, all the features tested are working, so that’s great news !
Today Gabriel started to work in the code to write in the SPI flash memory. Thalita and I continue working in OpenOCD to support writting in the NVM flash memory of SmartFusion.
We organized our presentation for tomorrow too.
Some diagrams to help understand the project :
Hardware diagram :
Flashing the FPGA Fabric diagram :
More updates tomorrow.
Saturday our PCB was completed, some screen shots :
Gabriel is working in the DirectC, a set of code to implement In-application programming (IAP) for the Cortex and FPGA. The main goal is to program the FPGA from an image.dat file generated by Libero IDE as we won’t be using a FlashPro chip and we are not sure if the FlashPro software can be used without it.
We also studied how to work with Libero, route pins of FPGA and generate an image.dat file. The program is not complicated and the Libero Project of Tutobot should be ready soon.
Now Thalita and I, we are working in a patch to OpenOCD to be able to write in the flash memory of SmartFusion by OpenOCD. The idea is loading a code in RAM which writes on the Flash as we didn’t find any documentation about driving the Flash memory directly through JTAG.
More updates tomorrow.