deshipu / micropython-dev-docs

Documentation on how to develop C modules for MicroPython
15 stars 17 forks source link

Compilation error following "Adding a Module" section #6

Closed justinmoon closed 4 years ago

justinmoon commented 6 years ago

In the "Adding a Module" section of your wonderful documentation, the code seems to import a portmodules.h file which doesn't exist within the esp8266 port.

When I attempt to compile I get this error:

mymodule.c:5:25: fatal error: portmodules.h: No such file or directory
 #include "portmodules.h"

If I remove that line it complies just fine.

anandcpanchal commented 5 years ago

I got the same issue

harryofskyrim commented 5 years ago

Kinda works if you move the file from another port.

deshipu commented 5 years ago

The problem is that this was written for a then-current-now-old version of MicroPython, and to be honest I lost all hope of following all the changes being done willy-nilly in there. I don't have the resources to track every change and amend this documentation according to it, and I know of no place where breaking changes like this would be announced.

I will gladly accept any pull requests if someone figures out what needs to be changed, though.

saramonteiro commented 4 years ago

Hi, I was just following the "Adding a Module" section and I had the same problem. I thought the docs were outdated and suspected the file portmodules.h should be replaced by another one. Firstly I searched around the directories for this file, but I did not find it on esp32 dir and then by opening other C modules I realized one commom included file was "modmachine.h". Then I replaced this include and I got to build the firmware. For now I reached up the point I got to import my empty module on the REPL on a ESP32. I still don't know if I did the correct replacement or if it will have consequences on the future implementation, maybe I back here to say it. @justinmoon @deshipu

saramonteiro commented 4 years ago

Other inconsistency I faced was not to find the .irom0.text section. The docs says I have to place the "*.ld" file name on this section otherwise the instructions code goes to ram instead of rom memory. I couldn't find this section and did nothing about this, so maybe part of my firmware is occupying ram space. I don't know.

deshipu commented 4 years ago

This documentation is now superseded by https://micropython-usermod.readthedocs.io/