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 default pin mappings in the built binary #408

Merged
merged 2 commits into from
Jul 16, 2023

Conversation

bsstephan
Copy link
Contributor

Note this can only document the defaults, since it's baked into the firmware binary and not dynamically generated at runtime. Demo:

bss@garnet ~/proj/GP2040-CE % picotool info -a
Program Information
 name:          GP2040-CE
 version:       0.7.2
 features:      double reset -> BOOTSEL
 binary start:  0x10000000
 binary end:    0x100b4e90

Fixed Pin Information
 5:   L2
 6:   R2
 7:   B2
 8:   B1
 9:   L1
 10:  R1
 11:  B4
 12:  B3
 13:  S2
 14:  A1
 15:  S1
 16:  Left
 17:  Right
 18:  Down
 19:  Up
 20:  A2
 21:  L3
 22:  R3

Build Information
 sdk version:       1.5.0
 pico_board:        pico
 boot2_name:        boot2_w25q080
 build date:        Jul 13 2023
 build attributes:  Release

Device Information
 flash size:   16384K
 ROM version:  3

I want to do more of this kind of thing, but for now this is a tiny quick win.

this can be seen by `picotool info -a file.uf2` or by `picotool info -a`
when the board is in BOOTSEL mode
#include "BoardConfig.h"

// generate binary information for picotool info, etc.
#if(PIN_DPAD_UP >= 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't 0 a valid pin definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Copy link
Contributor

@arntsonl arntsonl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a neat change. We can add extra stuff to the build info and maybe even parse it into JSON? Some really good ideas here

@arntsonl arntsonl merged commit 7dbd834 into OpenStickCommunity:main Jul 16, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants