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

[LPC11U68] Fix pin interrupt select offset #2747

Merged
merged 2 commits into from
Sep 24, 2016
Merged

Conversation

toyowata
Copy link
Contributor

@toyowata toyowata commented Sep 20, 2016

Description

This pull request fix an issue of InterruptIn failure in particular port (PIO2[7:0]) of the LPC11U68 platform.
A test code below didn't work properly (no interrupt occurred), because of wrong offset for PINTSEL register setting.

#include "mbed.h"

Serial pc(USBTX, USBRX);
DigitalOut myled(LED1);
DigitalOut green(LED2, 1);

InterruptIn in(D9); // PIO2_3

void func()
{
    green = !green;
}

int main()
{
    in.mode(PullUp);
    in.fall(&func);
    pc.printf("hello, mbed\n");
    while(1) {
        myled = 1;
        wait(0.7);
        myled = 0;
        wait(1.2);
    }
}

This PR made fix for offset calculation for PINTSEL register which is described as users manual as follows.

lpc11u68_pintsel

Status

READY

Related PRs

None

Todos

  • Review

Deploy notes

Notes regarding the deployment of this PR. These should note any
required changes in the build environment, tools, compilers, etc.

None

Test result

Test summary:
+--------+----------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| Result | Target   | Toolchain | Test ID     | Test Description                      | Elapsed Time (sec) | Timeout (sec) | Loops |
+--------+----------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| OK     | LPC11U68 | uARM      | DTCT_1      | Simple detect test                    |        0.51        |       10      |  1/1  |
| OK     | LPC11U68 | uARM      | EXAMPLE_1   | /dev/null                             |        3.53        |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_10     | Hello World                           |        0.39        |       5       |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_11     | Ticker Int                            |       11.38        |       15      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_12     | C++                                   |        1.37        |       10      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_16     | RTC                                   |        4.63        |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_2      | stdio                                 |        0.8         |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_23     | Ticker Int us                         |       11.36        |       15      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_24     | Timeout Int us                        |       11.64        |       15      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_25     | Time us                               |        11.4        |       15      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_26     | Integer constant division             |        1.38        |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_34     | Ticker Two callbacks                  |        11.4        |       15      |  1/1  |
| FAIL   | LPC11U68 | uARM      | MBED_37     | Serial NC RX                          |        2.01        |       20      |  0/1  |
| FAIL   | LPC11U68 | uARM      | MBED_38     | Serial NC TX                          |        0.94        |       20      |  0/1  |
| OK     | LPC11U68 | uARM      | MBED_A1     | Basic                                 |        1.38        |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_A21    | Call function before main (mbed_main) |        1.45        |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_A9     | Serial Echo at 115200                 |        1.26        |       20      |  1/1  |
| OK     | LPC11U68 | uARM      | MBED_BUSOUT | BusOut                                |        2.31        |       15      |  1/1  |
+--------+----------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
Result: 2 FAIL / 16 OK

Completed in 152.19 sec

Test summary:
+--------+----------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| Result | Target   | Toolchain | Test ID     | Test Description                      | Elapsed Time (sec) | Timeout (sec) | Loops |
+--------+----------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| OK     | LPC11U68 | GCC_CR    | DTCT_1      | Simple detect test                    |        0.51        |       10      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | EXAMPLE_1   | /dev/null                             |        3.5         |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_10     | Hello World                           |        0.4         |       5       |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_11     | Ticker Int                            |       11.38        |       15      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_12     | C++                                   |        1.4         |       10      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_16     | RTC                                   |        4.64        |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_2      | stdio                                 |        0.78        |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_23     | Ticker Int us                         |       11.39        |       15      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_24     | Timeout Int us                        |       11.91        |       15      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_25     | Time us                               |        11.4        |       15      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_26     | Integer constant division             |        1.41        |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_34     | Ticker Two callbacks                  |       11.39        |       15      |  1/1  |
| FAIL   | LPC11U68 | GCC_CR    | MBED_37     | Serial NC RX                          |        2.01        |       20      |  0/1  |
| FAIL   | LPC11U68 | GCC_CR    | MBED_38     | Serial NC TX                          |        0.92        |       20      |  0/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_A1     | Basic                                 |        1.37        |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_A21    | Call function before main (mbed_main) |        1.44        |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_A9     | Serial Echo at 115200                 |        1.27        |       20      |  1/1  |
| OK     | LPC11U68 | GCC_CR    | MBED_BUSOUT | BusOut                                |        2.32        |       15      |  1/1  |
+--------+----------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
Result: 2 FAIL / 16 OK

Completed in 154.39 sec

* Fix incorrect comment
* Add offset value calculation by interrupt port number
@sg-
Copy link
Contributor

sg- commented Sep 22, 2016

👍

@sg- sg- added the needs: CI label Sep 22, 2016
@sg-
Copy link
Contributor

sg- commented Sep 22, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

[Build 964]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 23, 2016

[Build 964]

Looks good.

2 failures with uvisor are not related to this changeset

/* Gets offset value for each port */
uint32_t offset;
switch ((pin >> PORT_SHIFT) & 0x3) {
case 0: offset = 0; break; // PIO0[23:0]
Copy link
Contributor

@0xc0170 0xc0170 Sep 23, 2016

Choose a reason for hiding this comment

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

style: should be on new lines

case 0: 
    offset = 0;  
    break; // PIO0[23:0]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done and updated.

@toyowata
Copy link
Contributor Author

@0xc0170 Done. Please can you review this.

@sg- sg- merged commit 2eb0b2c into ARMmbed:master Sep 24, 2016
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets

2669: Added u-blox C029 target ARMmbed/mbed-os#2669
2707: [EFM32] Add IAR support for remaining Silicon Labs targets ARMmbed/mbed-os#2707
2819: MultiTech xDot platform support - 09.26.2016 ARMmbed/mbed-os#2819
2827: include MultiTech xDot in mbed 5 releases ARMmbed/mbed-os#2827

Fixes and Changes

2522: Add CThunk for CM7 ARMmbed/mbed-os#2522
2518: Enable uvisor on Beetle ARMmbed/mbed-os#2518
2571: STM32F7 - Add asynchronous serial ARMmbed/mbed-os#2571
2616: STM32F3xx - Add Serial Flow Control pins + enable it ARMmbed/mbed-os#2616
2619: NUCLEO_L152RE - Add Serial Flow Control ARMmbed/mbed-os#2619
2620: NUCLEO_F429ZI - Add SERIAL_FC macro ARMmbed/mbed-os#2620
2666: [EFM32] Microsecond ticker optimization ARMmbed/mbed-os#2666
2681: STM32F0xx - Add support of ADC internal channels ARMmbed/mbed-os#2681
2687: [NRF5] Add fs_data symbol in data secton for gcc ARMmbed/mbed-os#2687
2696: Add device_has to all nrf51 devices ARMmbed/mbed-os#2696
2703: TARGET_NRF5: Changed 'serial_baud' implementation to support special baud rates. ARMmbed/mbed-os#2703
2704: DISCO_L476VG: add SPI nicknames ARMmbed/mbed-os#2704
2723: KSDK serial_api.c: Fix assertion error for ParityEven ARMmbed/mbed-os#2723
2463: [STM32L0] Add asynchronous serial ARMmbed/mbed-os#2463
2572: Fix STM32F407VG target name and LPC11U6X linker errors ARMmbed/mbed-os#2572
2698: DELTA_DFBM_NQ620 target ARMmbed/mbed-os#2698
2542: Dev spi asynch stm32f4 ARMmbed/mbed-os#2542
2650: STM32F3 - Add low power timer ARMmbed/mbed-os#2650
2415: [STM32F0] Add asynchronous serial ARMmbed/mbed-os#2415
2585: Added support for ADC only pins in LPC43xx ARMmbed/mbed-os#2585
2622: [STM32F4] Add asynchronous I2C ARMmbed/mbed-os#2622
2719: Updated ARM linker scripts for Kinetis platforms that use SDK 2.0 ARMmbed/mbed-os#2719
2728: Added ethernet and enabled IPV4 feature for the EVK-ODIN-W2/C029 target ARMmbed/mbed-os#2728
2747: [LPC11U68] Fix pin interrupt select offset ARMmbed/mbed-os#2747
2751: STM32L0xx - Add Serial Flow Control ARMmbed/mbed-os#2751
2753: [NUCLEO_F767ZI] Add CAN capability ARMmbed/mbed-os#2753
2759: STM32F0 - Add low power timer ARMmbed/mbed-os#2759
2763: STM32L1 - Add low power timer ARMmbed/mbed-os#2763
2764: STM32L4 - Add low power timer ARMmbed/mbed-os#2764
2771: STM32L4 - Update deepsleep implementation ARMmbed/mbed-os#2771
2775: Update KSDK SDHC driver for K64F & K66F ARMmbed/mbed-os#2775
2792: [NUCLEO_F303ZE] MBED-OS5 capability ARMmbed/mbed-os#2792
2762: STM32L0 - Add low power timer ARMmbed/mbed-os#2762
2761: STM32F7 - Add low power timer ARMmbed/mbed-os#2761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants