Skip to content

build for KW40z, KW41z fails to generate isr_tables #13122

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

Closed
jonas-rem opened this issue Feb 7, 2019 · 3 comments · Fixed by #15127
Closed

build for KW40z, KW41z fails to generate isr_tables #13122

jonas-rem opened this issue Feb 7, 2019 · 3 comments · Fixed by #15127
Assignees
Labels
area: GPIO bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: medium Medium impact/importance bug
Milestone

Comments

@jonas-rem
Copy link
Collaborator

Describe the bug
Building an example for a frdm_kw41z results in a failure in generating isr_tables when gpio portb is enabled:

[ 97%] Generating isr_tables.c
gen_isr_tables.py: multiple registrations at table_index 31 for irq 31 (0x1f)
Traceback (most recent call last):
  File "/[..]/zephyr/arch/common/gen_isr_tables.py", line 308, in <module>
    main()
  File "/[..]/zephyr/arch/common/gen_isr_tables.py", line 300, in main
    error("multiple registrations at table_index %d for irq %d (0x%x)" % (table_index, irq, irq))
  File "/[..]/zephyr/arch/common/gen_isr_tables.py", line 35, in error
    raise Exception()
Exception
make[2]: *** [zephyr/CMakeFiles/kernel_elf.dir/build.make:63: zephyr/isr_tables.c] Error 1
make[1]: *** [CMakeFiles/Makefile2:314: zephyr/CMakeFiles/kernel_elf.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

To Reproduce
Steps to reproduce the behavior:

  1. enable GPIO_MCUX_PORTB in boards/arm/frdm_kw41z/Kconfig.defconfig
  2. build e.g. hello_world example
  3. cmake -DBOARD=frdm_kw41z
  4. make
  5. See error

Impact
Examples for frdm_kw41z or boards based on kw40z and kw41z will fail in building when all gpios are activated

Screenshots or console output
in debug mode, I'm getting this:

[ 97%] Generating isr_tables.c
gen_isr_tables.py: (32, 0)
gen_isr_tables.py: Configured interrupt routing
gen_isr_tables.py: handler    irq flags param
gen_isr_tables.py: --------------------------
gen_isr_tables.py: 0x1957     31  0     0x20000ed0
gen_isr_tables.py: 0x1957     31  0     0x20000edc
gen_isr_tables.py: 0x1957     30  0     0x20000ee8
gen_isr_tables.py: offset is 0
gen_isr_tables.py: num_vectors is 32
gen_isr_tables.py: multiple registrations at table_index 31 for irq 31 (0x1f)

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Commit SHA or Version used: 0f3bd0f

Additional context
This check was recently introduced by #11273 by @andrewboie, issue is similar to k64 in #11275.
possible fix: Assign a different interrupt number in nxp_kw40z.dtsi and nxp_kw41z.dtsi.
How were the numbers 30/31 selected? Which number to select instead of 31?

@jonas-rem jonas-rem added the bug The issue is a bug, or the PR is fixing a bug label Feb 7, 2019
@galak galak changed the title dts: build for KW40z, KW41z fails to generate isr_tables build for KW40z, KW41z fails to generate isr_tables Feb 7, 2019
@galak galak added the platform: NXP NXP label Feb 7, 2019
@galak galak added priority: medium Medium impact/importance bug area: GPIO labels Feb 7, 2019
@galak
Copy link
Collaborator

galak commented Feb 7, 2019

I think the change from @andrewboie is just showing an issue in that we need to implement a shared GPIO handler for this case in the mcux gpio driver.

@andrewboie
Copy link
Contributor

gen_isr_tables.py: 0x1957     31  0     0x20000ed0
gen_isr_tables.py: 0x1957     31  0     0x20000edc

Yeah, before I added the check it was undefined which would be installed; same handler function in both cases but the parameter would be one or the other for all interrupts which is not what you want.

@galak galak added this to the v1.14.0 milestone Feb 9, 2019
@agansari
Copy link
Collaborator

@jremmert-phytec-iot KW41z platform uses IRQ 31 for both Port B & C's GPIOs. Port B is also used for ADC and other peripherals, this is why it's normally disabled.
@galak @andrewboie a proper implementation would be to check on IRQ 31 both PORTB_ISFR and PORTC_ISFR registers to check the source of the interrupt in this particular case. In general, I don't see how to create a generic configuration for peripherals that share the same interrupt.

A fast and middle-ground way to fix this is to remove interrupts on GPIOB.
GPIO on port B is not used by default, no pinmux initialization; let alone pin interrupts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants