Skip to content

Add FlashIAP support for REALTEK_RTL8195AM #4565

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
Jul 3, 2017
Merged

Conversation

Archcady
Copy link
Contributor

Port REALTEK flash APIs to mbed, add FlashIAP support for REALTEK_RTL8195AM

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 15, 2017

@Archcady can you share the test results of flash HAL API and flashIAP ?

@Archcady
Copy link
Contributor Author

Hi @0xc0170, I test it with ARM, GCC_ARM and IAR and here's result with ARM compilers. All testes for all compilers are passed.

mbedgt: test suite report:
+-----------------------+-------------------+-------------------------------------+--------+--------------------+-------------+
| target                | platform_name     | test suite                          | result | elapsed_time (sec) | copy_method |
+-----------------------+-------------------+-------------------------------------+--------+--------------------+-------------+
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-flashiap | OK     | 17.41              | shell       |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | OK     | 17.75              | shell       |
+-----------------------+-------------------+-------------------------------------+--------+--------------------+-------------+
mbedgt: test suite results: 2 OK
mbedgt: test case report:
+-----------------------+-------------------+-------------------------------------+-------------------------------+--------+--------+--------+--------------------+
| target                | platform_name     | test suite                          | test case                     | passed | failed | result | elapsed_time (sec) |
+-----------------------+-------------------+-------------------------------------+-------------------------------+--------+--------+--------+--------------------+
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-flashiap | FlashIAP - init               | 1      | 0      | OK     | 0.01               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-flashiap | FlashIAP - program            | 1      | 0      | OK     | 0.17               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-flashiap | FlashIAP - program errors     | 1      | 0      | OK     | 0.01               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | Flash - buffer alignment test | 1      | 0      | OK     | 0.08               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | Flash - clock and cache test  | 1      | 0      | OK     | 0.04               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | Flash - erase sector          | 1      | 0      | OK     | 0.05               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | Flash - init                  | 1      | 0      | OK     | 0.03               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | Flash - mapping alignment     | 1      | 0      | OK     | 0.01               |
| REALTEK_RTL8195AM-ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash        | Flash - program page          | 1      | 0      | OK     | 0.11               |
+-----------------------+-------------------+-------------------------------------+-------------------------------+--------+--------+--------+--------------------+
mbedgt: test case results: 9 OK
mbedgt: completed in 36.09 sec

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 20, 2017

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 593

Test failed!

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 603

Test failed!

@studavekar
Copy link
Contributor

NRF52_DK-GCC_ARM.tests-mbedmicro-rtos-mbed-basic.tests-mbedmicro-rtos-mbed-basic - Failed

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 607

All builds and test passed!

Copy link
Contributor

@adbridge adbridge left a comment

Choose a reason for hiding this comment

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

Can you please double check the code for mbed coding standards , plus some minor other comments

flash_turnon();
//obj->flash_size = FLASH_SIZE;
//obj->sector_size = FLASH_SECTOR_SIZE;
//obj->page_size = FLASH_PAGE_SIZE;

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this code commented out ?

{
u8 Status = 0;
if (address < FLASH_START || address >= FLASH_END)
return (uint32_t)-1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this value being returned as an error value ? If this is the case, would an explicit sector size of 0 not be better in this case ?

{
if (!SpicFlashInitRtl8195A(SpicOneBitMode)){

DBG_8195A("SPI Init Fail!!!!!!\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this debug code meant to be left in ?

if(flashtype == FLASH_MICRON){
SpicWaitOperationDoneRtl8195A(flashobj.SpicInitPara);
} else
{
Copy link
Contributor

Choose a reason for hiding this comment

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

should this { be on the else line ?

*ptr = *pbuf;
pbuf++;
ptr++;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like your formatting has gone a bit funny here ?

int flash_stream_write(flash_t *obj, uint32_t addr, uint32_t len, uint8_t *data){
return flash_ext_stream_write(obj, addr, len, data);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Above two functions '{' should be on newline

@theotherjimmy
Copy link
Contributor

@Archcady could you address @adbridge's review?

@Archcady
Copy link
Contributor Author

Thanks @adbridge @theotherjimmy , I've add a coding style patch for this.

@adbridge adbridge closed this Jun 27, 2017
@adbridge adbridge reopened this Jun 27, 2017
@sg- sg- removed the needs: work label Jun 27, 2017
@adbridge
Copy link
Contributor

LGTM

@adbridge
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 663

Test failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 28, 2017

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 673

Test failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 29, 2017

retest uvisor

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 29, 2017

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 689

Test failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 30, 2017

retest uvisor

@adbridge
Copy link
Contributor

adbridge commented Jun 30, 2017

Morph test failed for
mbedgt: test suite 'tests-mbedmicro-rtos-mbed-basic' ................................................. FAIL in 26.45 sec
IAR only

@theotherjimmy
Copy link
Contributor

/morph test

1 similar comment
@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

mbed-bot commented Jul 2, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 716

All builds and test passed!

@adbridge adbridge merged commit c826e2f into ARMmbed:master Jul 3, 2017
@Archcady Archcady deleted the flash branch July 10, 2017 05:46
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