Skip to content

fix - KL46Z cmsis header (v2.2), shared interrupt PORTCD #136

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
wants to merge 1 commit into from

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Dec 30, 2013

The ollder KL46Z CMSIS header file falsely named IRQ vector PORTD which is actually PORTC and PORTD interrupt vector. I changed gpio irq implementation to reflect this header file update.

I also added a small comment to enable/disable_irq in the interruptIN class for users awareness of what it can do.

Please keep this request open until Sam's approval. Thanks.

Regards,
0xc0170

	- Ports C and D sharing same interrupt vectors
	- KL46Z CMSIS header update
	- InterruptIn methods irq_disable/enable comment update
@sg-
Copy link
Contributor

sg- commented Dec 30, 2013

I tried to add a this change using github edit but cant seem to get the tool to work ;( Anyways, all seems good with one change needed.

In gpio_irq_api.c the implementation of qpio_irqCD need to test for the PORT being powered:

void gpio_irqCD(void) {
    /* PORTC and PORTD share same vector - Make sure the PORT is powered before reading or HARD FAULT!! */
    if ((SIM->SCGC5 & (1 << SIM_SCGC5_PORTC_SHIFT)) == (1 << SIM_SCGC5_PORTC_SHIFT))
        handle_interrupt_in(PORTC, 32);
    if ((SIM->SCGC5 & (1 << SIM_SCGC5_PORTD_SHIFT)) == (1 << SIM_SCGC5_PORTD_SHIFT))
        handle_interrupt_in(PORTD, 64);
}

This will avoid hard faulting if the user doesn't have a pin created on both PORTC and PORTD since they both share a handler.

I guess you could also enable power to PORTC when PORTD pins are created and the other way around to save a few instructions in the IRQ.

@sg- sg- closed this Dec 30, 2013
yossi2le pushed a commit to yossi2le/mbed-os that referenced this pull request Jan 2, 2019
Note the application-start-address is deeper in the flash to allow
a debug profile build of the bootloader including the softdevice
lrusinowicz pushed a commit to lrusinowicz/mbed-os that referenced this pull request Feb 5, 2019
Updating mbed-os to mbed-os-5.9.7
artokin added a commit to artokin/mbed-os that referenced this pull request Dec 2, 2021
….fa69b180d3

fa69b180d3 Reorganize CMakeFiles based on target (ARMmbed#138)
6eef38f502 Merge pull request ARMmbed#137 from PelionIoT/cmake_and_gtest
136b71e222 Adjust flags in CMakeLists.txt
e9c7160a1b Follow Mbed OS coding style
d0e449ca68 Fix remaining tests and add readme
5906229e46 Remove obsolete files
ad091ba716 Convert coap_service_api to Google Test
adf041d095 Convert coap-security-handler to Google Test
b7de61b4b7 fix compiler warnings
a21770928e Convert coap-message-handler to google test
af9bcacbe9 Convert to GoogleTests
1c89cc60a3 CMakeLists.txt update
3bbf2cfc9f Move tests to proper place
e4d9f6143b Sync Cmake changes from Mbed OS (ARMmbed#136)

git-subtree-dir: connectivity/nanostack/coap-service
git-subtree-split: fa69b180d3353f77ca0ac312b6a93f3c773bbe19
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.

2 participants