Porting RRF to another chip
-
Hello,
I would like to port the Duet FW to SAMG55 and I have some questions about the structure and tools to use it. It may be placed in Future view forum, but there are no topics so I choosed this one. The questions are for developers anyway.
So my goal is to use another platform (Atmel SAMG55). I have done initial research that I can fit a printer on this chip witch few modifications.
For me as newbie in RRF is kind of hard to understand the structure of the project. My guess is that's just because of historical reasons. Is there any document describing where are located particular components and why? This is what I found about RF so far. Whole thing is separated in two projects. CoreNG and firmware itself. CoreNG contains HW specific code and it is mashup of Arduino and ASF functions. What surprised me is there is also HW related configurations in firmware as well. This is the point where My first question comes from.
-
Are you guys planning to continue in this structure, or do you have some plans to merge it in one project and change the structure? Please do not think I'm saying the structure is bad and should be changed. I know it is hard to maintain project about this size:) I saw you guys are working hard on implementing freeRTOS which is great. But due tho this I assume you are pretty busy and don't have much time for this. If you are thinking to change the structure or to cut out some libraries (Arduino), it would be really beneficial for me to know, because than I can make the port according to your new concept.
-
Could you give me some advice about porting it to new chip? At best I would like to avoid using Arduino and ASF, but I know it is not quite possible. After some initial tests I have done with G55 I found using ASF slow things down about 20% and I think it would be the same with arduino. By this question I'm asking about some tips how to do the port most clean and quick way. Because you know the structure best.
-
I was able to build the firmware with Eclipse, but found it quite complicated when it comes to debugging. I tried to import packs with register view, but I have no success yet. Atmel studio has nice interface for register view and so. BUT. When I tried to load the coreNG project into Atmel studio it was slow as hell. I was not able to scroll down the code and it was just horrible. So. How do you debug the firmware in eclipse? Or do you use another environment for development?
Many thanks for your time and sorry about that long post:)
-
-
We have no plans to change the present 2-module structure. CoreNG is used to build the IAP program as well as RRF.
Much (perhaps most) of the code in the Arduino folder is code that we wrote or that we rewrote extensively.
We don't use the ASF where fast I/O is needed, for example for basic port I/O, UART I/O or SPI data transfer functions. So if you expect that removing the remaining use of ASF will give a significant speed improvement, I think you are mistaken. I suggest you use a SAMG55 build of the existing CoreNG project. Please note, we have modified a few of the ASF files (e.g. the hsmci files) and the modifications may need to be adapted for a new processor.
HTH David
-
David, thanks for an answer. Good to hear that ASF is not used for critical code. Do you have any particular project in mind for the CoreNG? I found two which I may start with, but you might know about better one:)
https://github.com/aethaniel/ExperimentalCore-sam
https://github.com/ultimachine/FeynmanCore -
@filipkotoucek said in Porting RRF to another chip:
David, thanks for an answer. Good to hear that ASF is not used for critical code. Do you have any particular project in mind for the CoreNG? I found two which I may start with, but you might know about better one:)
https://github.com/aethaniel/ExperimentalCore-sam
https://github.com/ultimachine/FeynmanCoreI suggest that you just build the existing CoreNG project with the processor type set to SAMG55. You will need to:
- add the ASF files for the SAMG55 to the asf source tree in the correct psition
- make a new src/variants folder for your variant and provide SAMG55 versions of the startup_ and system_ source files in it. These are derived from examples in ASF, I forget the original path name but it had templates/gcc in it
- change the paths to include the samg55 include files
-
I managed to compile CoreNG for SAMG without errors (pretty sure it is not compatible with FW yet). Now I created new target in RRF and trying to compile it. I have a question about SD card support. Has the RRF used SD card support from beginning? I'm asking because SAMG can access SD card only through SPI. Is there some way how to completely disable storage?
Due to minimum of free pins on SAMG the optimal situation would be to disable SD support and write the configurations into the code. I'm considering what will be the easier way to get it working. Should I rewrite the SD card driver so RRF can use it as now does, or rewrite RRF not to use the SD at all?
-
Not have an attached SD card would be a severe disadvantage, so I suggest you use SPI. Alternatively, use a SAM chip with HSMCI support and more pins. For the Duet Maestro, we chose the 100-pin SAM4S.