cristianowa / elua4stellarisLauchpad

Attempt to port eLua to stellaris lauchpad.
Other
0 stars 0 forks source link

Research on Features #19

Open jvportal opened 11 years ago

jvportal commented 11 years ago

As written in elua4stellarisLauchpad/src/platform/lm4f/IMPORTANT.TXT, the following files are project specific:

./conf.lua ./conf.py ./flash_conf.h ./lm4f.ld ./lm4f_pio.c ./platform.c ./platform_conf.h ./platform_int.c ./stacks.h ./startup_gcc.c (this a modified stellarisware file) ./type.h

Some of these files have many TODOs (for example, implement CAN, SPI, PWN, etc.) and stub functions for for features. The problem is: we don't know if these resources even exist in the EK-LM4F120XL board.

The task of this issue can be split in the following steps:

1) Make a list of features supported by the board (CAN, SPI, hibernation, floating point instructions, thumb2* instructions, etc.). See the docs of the board and of the microcontroller in the folder "docs_stellaris". Post here the result of the research.

2) For each feature supported by the board, open an issue in github to implement (and test) the feature. Important: comment on the created issue that the feature must be implemented using as much "#ifdef FOR_THIS_BOARD" or/and "#ifdef FOR_THIS_MICROCONTROLLER" as possible. In the future, the code of lm4f may be shared with similar microcontrollers and boards.

3) Make a list of features present in the project specific files (these features have TODOs, stub functions and defines in the files). For example, SPI has stub functions and TODOs in file "project.c" and has an define (NUM_SPI) in "platform_conf.h" (more code and comments of SPI may exist in other files of the project). Post here the result of the research.

4) For each feature present in the project specific files, see if this feature is present in the list of features supported by the board (this list was created in step 1). If the feature exist in the files but don't exist in the board, delete the code and TODOs of this feature in the files, delete or adjust the defines of this feature in the files (for example, if SPI doesn't exist in the board, set NUM_SPI to zero) and delete the issues related to this feature in github.

The task of this issue is essential to the project. It's also important to avoid spending too much time in this task (do not plunge too deeply in the microcontroller datasheet). Just see the documentation of the board, maybe take a look at the microcontroller datasheet and do the task. All necessary docs are in "docs_stellaris" folder. There isn't much code to be seen in the project specific files either. See "Project Status" in the wiki of github to learn what is already implemented in the board at present moment.

This issue can be done by more than one developer: step 1 is independent of the others; step 2 depends on step 1; step 3 is independent of the others; step 4 depends on steps 1 and 3. I could have split this task in more issues, but I prefer to maintain all in one issue to concentrate the information of the whole task.

* I believe that the Cortex-M4 may use thumb2 instructions, but it's using thumb instruction at this moment.

cristianowa commented 11 years ago

The main features to be supported are with TODOs in the plataform.c file. Start there.