Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document interfaces that should be implemented by boards platforms #985

Open
3 tasks done
matthijskooijman opened this issue Nov 13, 2015 · 5 comments
Open
3 tasks done
Assignees
Labels
topic: documentation Related to documentation for the project type: enhancement Proposed improvement

Comments

@matthijskooijman
Copy link
Collaborator

matthijskooijman commented Nov 13, 2015

Describe the request

We need some more exhaustive documentation about the "interface" that a core or variant should expose.

In particular:

  • All of the required keys in platform.txt, boards.txt and programmers.txt, and what they are used for, should be listed. These keys form the "external interface" of the core, which can be used by the IDE or arduino-builder. A core can also contain arbitrary other keys, which are used for variable substitutions internally, but cannot be relied on to exist is all cores. Currently, this distinction is blurry and ad-hoc.
  • All of the macros, functions and variables that a variant of the Arduino core should expose should be documented. Some of these are mean to be used by the sketch directly (and should actually be documented as part of the normal Arduino reference), but some of them are only used internally by the Arduino core as part of another API. Currently, no definitive list of these exists, making variants (both third-party and Arduino ones) inconsistent or incomplete.

Both of these pieces of documentation should be updated when the requirements change in future IDE or core versions, with the changes mentioned explicitly and with the IDE or core version that introduced them.

Describe the current behavior

The **Arduino Platform Specification documents a good deal of the structure and has examples, but is not exhaustive or explicit.

Additional context

Related

Additional requests

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
matthijskooijman referenced this issue in arduino/arduino-builder Nov 13, 2015
For each source file found, gcc -E is continuously run until it doesn't report
any error. When it reports an error, it is in the form of
Ethernet.h: No such file or directory
 #include <Ethernet.h>
Ethernet.h is searched from known libraries, its -I param added to gcc -E and
gcc -E is rerun
If Ethernet.h is not found, preprocessing fails and reports an error
If found, the collected list of -I params is used to preprocess another (sketch
or library) source file, until all dependendent libraries are resolved
Fixes #33

Signed-off-by: Federico Fissore <f.fissore@arduino.cc>
@matthijskooijman
Copy link
Collaborator Author

One additional angle should be covered: The interface that the Arduino core offers to its variants and derived (board-only) platforms. E.g., what variables does each tool, recipe, programmer, etc. assume are present and how they are used.

@per1234
Copy link
Contributor

per1234 commented Nov 13, 2015

Other thing that should be documented(assuming it's the intended behavior) is that Burn Bootloader uses the platform.txt of the selected board but Upload Using Programmer uses the platform.txt of the selected programmer. This has caused confusion for me and at least two other 3rd party cores because it wasn't documented(see arduino/Arduino#2886 and SpenceKonde/ATTinyCore@9c50151).

Edit: I've added this information to the wiki.

@matthijskooijman
Copy link
Collaborator Author

Also note this proposal I made (quite) a while ago already, which suggests to apply some versioning scheme to these interfaces, to make it easier to change them in the future while keeping compatibility: https://groups.google.com/a/arduino.cc/g/developers/c/H6vCRlgRTCo/m/22oQfVY3AgAJ

@matthijskooijman
Copy link
Collaborator Author

I just noticed that in the area of versioning, the SAMD core already applies some versioning to its variants by letting the variants define a constant to indicate what version of the core-variant interface they implement (I think). I dont' think there's any specific documentation about what this version number implies exactly, though.

See: https://github.com/arduino/ArduinoCore-samd/blob/56e13aa5ebb21f8aca8805e2bc0835a1f1fea372/cores/arduino/Arduino.h#L52

@ianfixes
Copy link

Subscribing for interest, via Arduino-CI/arduino_ci#251

I am trying to put boundaries around what would be considered the proper set of compilation mocks for Arduino, and the lack of official documentation on stuff like these:

#define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )

I can't find any official-looking documentation to say whether these are meant to exist for the long term and/or what their function should be (so that I can create proper unit tests for my mockups of them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants