Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Zephyr master broke frdm_k64f GPIO port naming #665

Closed
pfalcon opened this issue Jan 30, 2017 · 6 comments
Closed

Zephyr master broke frdm_k64f GPIO port naming #665

pfalcon opened this issue Jan 30, 2017 · 6 comments

Comments

@pfalcon
Copy link
Contributor

pfalcon commented Jan 30, 2017

They switched to "gpio_porta", "gpio_portb", long ugly strings. Well, just as I argued before, the Zephyr application software can't rely on any particular, and even consistent device naming scheme (sigh). Thanks to my previous patch, I can get my LED linking with "gpio_portb.21", the question what to do with zjs_k64f_pins.c. My kind suggestion is to dismantle all the pin maps from C space, and have k64f_pins.js, a101_pins.js, etc.

@grgustaf grgustaf added this to the 0.3 milestone Feb 1, 2017
@grgustaf grgustaf self-assigned this Feb 1, 2017
@grgustaf
Copy link
Contributor

grgustaf commented Feb 1, 2017

I'm currently working on updating to the iot-js-api style, and am busy trying to create another C version of the mapping for A101 as a strawman. But maybe I will see the light of doing this in JS. ;)

I think we'll have a "zephyr" board that lets you use these generic port/pin names to support boards without a convenience module. But yes this sure proves your point!

@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 1, 2017

Ok, so I submitted a patch to just revert to older FRDM-K64F GPIO naming and it was accepted by its maintainers: https://gerrit.zephyrproject.org/r/11668 . So, that gives us additional time to come up with something, and @grgustaf's your plan in good!

In the meantime, can we update deps/zephyr to the HEAD of v1.7-branch to pull this fix (and to be ready to work with Z 1.7 in general for the next Z.js release)? Should I submit a separate ticket on that?

@grgustaf
Copy link
Contributor

We have updated to 1.7 release so this shouldn't be an issue specifically. However, I can't seem to get any GPIO output pins working so I need to go back to some Zephyr samples and try to see what's going on. Today we theorized that maybe some default configs have changed.

grgustaf added a commit to grgustaf/zephyr.js-1 that referenced this issue Mar 31, 2017
Zephyr defaults changed around January for this board to no longer
set GPIO as default pinmux state for any of the external pins. So we
need to override them ourselves. Eventually we may need to get fancier
to set pinmux based on what the user's script wants to use the pins
for, or set up a default "ABI" for pinmux settings for the board. The
pinmux must be set up at board initialization time apparently.

Add new zjs_pinmux.c (currently for k64f only) to configure the
pinmux settings at initialization time.

Add a new prj.conf to enable GPIO port "D".

Add new samples GPIOInputs-k64.js and GPIOOutputs-k64.js to quickly
demonstrate which pins are functional.

With this update, pins D14 and D15 work as outputs for the first time.
But pin D8 on my rev E3 board doesn't seem to work as either anymore.

Fixes intel#514 and lets us finally see that intel#665 really was resolved.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
@grgustaf
Copy link
Contributor

#954 makes GPIOs work again so that we can see @pfalcon's Zephyr naming patch is in and working.

@grgustaf grgustaf added the fixed label Mar 31, 2017
@qiaojingx
Copy link

Verified with commit f3d587d + #954. This issue is not reproducible.

@pfalcon
Copy link
Contributor Author

pfalcon commented Apr 1, 2017

Thanks! I assume I'm in the best position to close it.

@pfalcon pfalcon closed this as completed Apr 1, 2017
jimmy-huang pushed a commit that referenced this issue Apr 3, 2017
Zephyr defaults changed around January for this board to no longer
set GPIO as default pinmux state for any of the external pins. So we
need to override them ourselves. Eventually we may need to get fancier
to set pinmux based on what the user's script wants to use the pins
for, or set up a default "ABI" for pinmux settings for the board. The
pinmux must be set up at board initialization time apparently.

Add new zjs_pinmux.c (currently for k64f only) to configure the
pinmux settings at initialization time.

Add a new prj.conf to enable GPIO port "D".

Add new samples GPIOInputs-k64.js and GPIOOutputs-k64.js to quickly
demonstrate which pins are functional.

With this update, pins D14 and D15 work as outputs for the first time.
But pin D8 on my rev E3 board doesn't seem to work as either anymore.

Fixes #514 and lets us finally see that #665 really was resolved.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants