Skip to content

GR_LYCHEE,RZ_A1H,VK_RZ_A1H: Fix greentea test failure with ARMC6 #10782

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

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

d-kato
Copy link
Contributor

@d-kato d-kato commented Jun 7, 2019

Description

Fix for issue #10729

Fix the following test failures.

  • tests-mbed_drivers-crc
    The task stack is insufficient. It succeeded when it increased from 320 bytes to 380 bytes.
    Change file : mbed-os\TESTS\mbed_drivers\crc\main.c

  • tests-mbed_drivers-flashiap and tests-mbed_hal-flash
    The flash driver process needs to be located in RAM, but the function "clear_spimd_reg()" has been replaced with "memset()" located in ROM due to the effect of optimization.
    The function "clear_spimd_reg()" has been changed to not be affected by optimization.
    Change file : mbed-os\targets\TARGET_RENESAS\TARGET_RZ_A1XX\flash.c

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@ciarmcom ciarmcom requested review from toyowata and a team June 7, 2019 03:00
@ciarmcom
Copy link
Member

ciarmcom commented Jun 7, 2019

@d-kato, thank you for your changes.
@toyowata @ARMmbed/mbed-os-test @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2019

The task stack is insufficient. It succeeded when it increased from 320 bytes to 380 bytes.

How do we know 380 bytes is sufficient? I am missing information in the commit.

The function "clear_spimd_reg()" has been changed to not be affected by optimization.

Without going in details how are functions implemented, how is adding volatile fixes it?

@d-kato
Copy link
Contributor Author

d-kato commented Jun 7, 2019

How do we know 380 bytes is sufficient? I am missing information in the commit.

I actually tried running the test. It failed at 360 bytes and succeeded at 370 bytes. It added 10 bytes as a margin and became 380 bytes.

Without going in details how are functions implemented, how is adding volatile fixes it?

It is a function to initialize the argument regset. All macro values ​​used in the function are 0.

static void clear_spimd_reg(volatile st_spibsc_spimd_reg_t * regset)
{
    /* ---- command ---- */
    regset->cde    = SPIBSC_OUTPUT_DISABLE;
    regset->cdb    = SPIBSC_1BIT;
    regset->cmd    = 0x00;
    /* ---- optional command ---- */
    regset->ocde   = SPIBSC_OUTPUT_DISABLE;
    regset->ocdb   = SPIBSC_1BIT;
    regset->ocmd   = 0x00;
    /* ---- address ---- */
    regset->ade    = SPIBSC_OUTPUT_DISABLE;
    regset->addre  = SPIBSC_SDR_TRANS;       /* SDR */
    regset->adb    = SPIBSC_1BIT;
    regset->addr   = 0x00000000;
    /* ---- option data ---- */
    regset->opde   = SPIBSC_OUTPUT_DISABLE;
    regset->opdre  = SPIBSC_SDR_TRANS;       /* SDR */
    regset->opdb   = SPIBSC_1BIT;
    regset->opd[0] = 0x00;    /* OPD3 */
    regset->opd[1] = 0x00;    /* OPD2 */
    regset->opd[2] = 0x00;    /* OPD1 */
    regset->opd[3] = 0x00;    /* OPD0 */
    /* ---- dummy cycle ---- */
    regset->dme    = SPIBSC_DUMMY_CYC_DISABLE;
    regset->dmdb   = SPIBSC_1BIT;
    regset->dmcyc  = SPIBSC_DUMMY_1CYC;
    /* ---- data ---- */
    regset->spide  = SPIBSC_OUTPUT_DISABLE;
    regset->spidre = SPIBSC_SDR_TRANS;       /* SDR */
    regset->spidb  = SPIBSC_1BIT;
    /* ---- Others ---- */
    regset->sslkp  = SPIBSC_SPISSL_NEGATE;   /* SPBSSL level */
    regset->spire  = SPIBSC_SPIDATA_DISABLE; /* read enable/disable */
    regset->spiwe  = SPIBSC_SPIDATA_DISABLE; /* write enable/disable */
}

[Test result]

mbedgt: test suite report:
+-----------------+---------------+-----------------------------+--------+--------------------+-------------+
| target          | platform_name | test suite                  | result | elapsed_time (sec) | copy_method |
+-----------------+---------------+-----------------------------+--------+--------------------+-------------+
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-crc      | OK     | 16.02              | default     |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-flashiap | OK     | 16.69              | default     |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_hal-flash        | OK     | 15.44              | default     |
+-----------------+---------------+-----------------------------+--------+--------------------+-------------+
mbedgt: test suite results: 3 OK
mbedgt: test case report:
+-----------------+---------------+-----------------------------+-----------------------------------+--------+--------+--------+--------------------+
| target          | platform_name | test suite                  | test case                         | passed | failed | result | elapsed_time (sec) |
+-----------------+---------------+-----------------------------+-----------------------------------+--------+--------+--------+--------------------+
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-crc      | Test SD CRC polynomials           | 1      | 0      | OK     | 0.05               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-crc      | Test not supported polynomials    | 1      | 0      | OK     | 0.06               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-crc      | Test partial CRC                  | 1      | 0      | OK     | 0.04               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-crc      | Test supported polynomials        | 1      | 0      | OK     | 0.05               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-crc      | Test thread safety                | 1      | 0      | OK     | 0.06               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-flashiap | FlashIAP - init                   | 1      | 0      | OK     | 0.09               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-flashiap | FlashIAP - program                | 1      | 0      | OK     | 0.55               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-flashiap | FlashIAP - program across sectors | 1      | 0      | OK     | 0.18               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-flashiap | FlashIAP - program errors         | 1      | 0      | OK     | 0.12               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_drivers-flashiap | FlashIAP - timing                 | 1      | 0      | OK     | 1.07               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_hal-flash        | Flash - clock and cache test      | 1      | 0      | OK     | 0.09               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_hal-flash        | Flash - erase sector              | 1      | 0      | OK     | 0.13               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_hal-flash        | Flash - init                      | 1      | 0      | OK     | 0.07               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_hal-flash        | Flash - mapping alignment         | 1      | 0      | OK     | 0.05               |
| GR_LYCHEE-ARMC6 | GR_LYCHEE     | tests-mbed_hal-flash        | Flash - program page              | 1      | 0      | OK     | 0.16               |
+-----------------+---------------+-----------------------------+-----------------------------------+--------+--------+--------+--------------------+
mbedgt: test case results: 15 OK
mbedgt: completed in 53.61 sec

Copy link
Contributor

@toyowata toyowata left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

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

Looks good !

@adbridge
Copy link
Contributor

Rerunning CI to ensure results are not stale

@mbed-ci
Copy link

mbed-ci commented Jun 19, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@adbridge adbridge merged commit 2a7635f into ARMmbed:master Jun 19, 2019
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.

7 participants