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

Add target RTL8710AF #7965

Closed
wants to merge 1 commit into from
Closed

Conversation

DanielDmlee
Copy link
Contributor

@DanielDmlee DanielDmlee commented Sep 3, 2018

Description

This pull request adds support for the Realtek RTL8710AF MCU. Port was done on the PADI IoT Stamp which sports this MCU. The target is relatively similar to the RTL8195AM except that no XIP is supported on the external flash.

Verified by running all test cases on the board, and by verifying that mbed-os-example-wifi works (same WiFi driver as the RTL8195AM is used).

Issues:

  • The same DAPLink version is used for both the RTL8195AM and the RTL8710AF. This causes Greentea to reject to run test cases on the board. Patched around it, see Greentea refuses to run tests on board due to name mismatch greentea#281.
    ** For Greentea test,
    Have to be separation RTL8195AM and RTL8710AF though DAPLink FW. Below comment is only temporarily can use for Greentea test.
  1. Have to be changing from "detect_code": ["4601"] to "detect_code": ["4600"], if DAPLink FW was not changed.
  2. after 1, have to be changing from REALTEK_RTL8710AF to REALTEK_RTL8195AM. This is only temporarily using for Greentea test.

Pull request type

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

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 3, 2018

Linker scripts for ARMCC and IAR are not correct. If someone has experience with these, please help getting them in. The GCC ARM linker script is correct.

What is not correct, an issue reported anywhere?

@0xc0170 0xc0170 changed the title Added new target RTL8710AF Add target RTL8710AF Sep 3, 2018
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 3, 2018

This is doing something similar to #7704 (that creates MCU target t hat this target can inherit from). As that one is blocked on another PR (should not, will update there if we can go ahead without that dependency)

@janjongboom
Copy link
Contributor

RTL8710 test results on GCC ARM 6 on PADI IoT Stamp, using Ameba RTL8195A dev board DAPLink interface.

@janjongboom
Copy link
Contributor

What is not correct, an issue reported anywhere?

No, we can't get them to work. I know (barely) how to write GCC linker scripts, but not IAR or ARMCC. If someone does know some assistance would be appreciated.

@SeppoTakalo
Copy link
Contributor

@DanielDmlee Can you run Mbed OS WiFi and Socket tests as instructed in https://github.com/ARMmbed/mbed-os/blob/940c4b891d66d6504f9f3fd86fefb05c1bf9a961/TESTS/netsocket/README.md

So you need to enable full test set, and supply SSID and password.

@DanielDmlee
Copy link
Contributor Author

@SeppoTakalo Okay I'll check 'Mbed OS WiFi and Socket tests'

@kissste
Copy link

kissste commented Sep 8, 2018

I'm having trouble and need help.

I have fetched this pull, as follows:
git fetch origin pull/7965/head:pr-7965
git checkout pr-7965

then:
mbed-cli compile -j0 -t GCC_ARM -m REALTEK_RTL8710AF -v

resulting error:

Compile [  7.3%]: ESP8266Interface.cpp
Compile: /usr/bin/arm-none-eabi-g++ -std=gnu++98 -fno-rtti -Wvla -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -Os -g1 -mcpu=cortex-m3 -mthumb -DFEATURE_LWIP=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DTARGET_RTW_EMAC -D__MBED_CMSIS_RTOS_CM -DTARGET_RTL8710A -DCONFIG_MBED_ENABLED -D__CMSIS_RTOS -DCONFIG_PLATFORM_8195A -DTOOLCHAIN_GCC -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DTARGET_Realtek -DTARGET_REALTEK_RTL8710AF -DTARGET_M3 -DDEVICE_INTERRUPTIN=1 -DMBED_BUILD_TIMESTAMP=1536374446.09 -DTARGET_CORTEX -DDEVICE_I2C=1 -DDEVICE_PORTOUT=1 -D__CORTEX_M3 -DTARGET_RTL8XXXA -DTARGET_RELEASE -DPLATFORM_CMSIS_RTOS -DDEVICE_PORTINOUT=1 -DDEVICE_PORTIN=1 -DTARGET_FF_ARDUINO -DTOOLCHAIN_GCC_ARM -DTARGET_AMEBA -DMBED_FAULT_HANDLER_DISABLED -DDEVICE_SPI=1 -D__RTL8195A__ -DDEVICE_SERIAL=1 -DTARGET_REALTEK_RTL8195AM -DDEVICE_FLASH=1 @./BUILD/REALTEK_RTL8710AF/GCC_ARM/.includes_e373f012f8f0c42947f47a918704b20f.txt -include ./BUILD/REALTEK_RTL8710AF/GCC_ARM/mbed_config.h -MD -MF BUILD/REALTEK_RTL8710AF/GCC_ARM/mbed-os/components/wifi/esp8266-driver/ESP8266Interface.d -o BUILD/REALTEK_RTL8710AF/GCC_ARM/mbed-os/components/wifi/esp8266-driver/ESP8266Interface.o ./mbed-os/components/wifi/esp8266-driver/ESP8266Interface.cpp
[Error] ESP8266Interface.cpp@26,30: 'D1' was not declared in this scope
[Error] ESP8266Interface.cpp@34,30: 'D0' was not declared in this scope
[DEBUG] Return: 1
[DEBUG] Output: ./mbed-os/components/wifi/esp8266-driver/ESP8266Interface.cpp: In constructor 'ESP8266Interface::ESP8266Interface()':
[DEBUG] Output: ./mbed-os/components/wifi/esp8266-driver/ESP8266Interface.cpp:26:30: error: 'D1' was not declared in this scope
[DEBUG] Output:  #define MBED_CONF_ESP8266_TX D1
[DEBUG] Output:                               ^
[DEBUG] Output: ./mbed-os/components/wifi/esp8266-driver/ESP8266Interface.cpp:44:12: note: in expansion of macro 'MBED_CONF_ESP8266_TX'
[DEBUG] Output:      : _esp(MBED_CONF_ESP8266_TX, MBED_CONF_ESP8266_RX, MBED_CONF_ESP8266_DEBUG),
[DEBUG] Output:             ^~~~~~~~~~~~~~~~~~~~
[DEBUG] Output: ./mbed-os/components/wifi/esp8266-driver/ESP8266Interface.cpp:34:30: error: 'D0' was not declared in this scope
[DEBUG] Output:  #define MBED_CONF_ESP8266_RX D0
[DEBUG] Output:                               ^
[DEBUG] Output: ./mbed-os/components/wifi/esp8266-driver/ESP8266Interface.cpp:44:34: note: in expansion of macro 'MBED_CONF_ESP8266_RX'
[DEBUG] Output:      : _esp(MBED_CONF_ESP8266_TX, MBED_CONF_ESP8266_RX, MBED_CONF_ESP8266_DEBUG),
[DEBUG] Output:                                   ^~~~~~~~~~~~~~~~~~~~

When compiling for -m REALTEK_RTL8195AM, there no errors.

Thank you

@janjongboom
Copy link
Contributor

@kissste error: 'D0' was not declared in this scope. You're using a pin which is not present on the 8710.

@SeppoTakalo
Copy link
Contributor

The problem is that

REALTEK_RTL8710AF": {
        "inherits": ["REALTEK_RTL8195AM"],

So this inherits all values from RTL8195AM, among one is the claim to be Arduino Form factor.

But this target is not.

When device claims to be Arduino form factor, it should define all Arduino pinnames. Some drivers that are now pulled in the Mbed OS tree, uses those pinnames.

To fix the issue @DanielDmlee should add following rule to this target:

"supported_form_factors": [],

@kissste
Copy link

kissste commented Sep 9, 2018

@SeppoTakalo Thank you. Compiles now. Next steps - upload firmware it and see whether it works.

@DanielDmlee
Copy link
Contributor Author

@SeppoTakalo @kissste Thank you, I updated target.json again.

@kissste
Copy link

kissste commented Sep 13, 2018

Sorry to bug you again.
I'm having trouble with flashing.
mbed's flash for rtl8710 does not work for me - 'no device identified', it's looking for CMSIS-DAP adapter and, taking the mbed's generated bin and flashing it to chip using JLink adapter+JLinkExe and/or STLink v2+openocd work - does not appear to be a valid image from RTL8710 chip's perspective.

Thank you

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 25, 2018

This will require rebase later. #7704 should go first (will contain driver update and MCU addition. this new target will inherit MCU definition,

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 9, 2018

Sorry for the delay, due to the release period and some CI issues, it took a bit longer to progress with #8266. It was integrated, can you please rebase this to update ?

This new target should inherit from realtek MCU_ target.

@janjongboom
Copy link
Contributor

@DanielDmlee ^

@DanielDmlee
Copy link
Contributor Author

Note that there was missing modified file at previous update, updated now.

@deepikabhavnani
Copy link

@DanielDmlee - Thanks for the PR. We are slowly migrating to IAR 8.x and ARMC6 and will like to know if the binaries in this PR are compatible to IAR 7.x and IAR 8.x? Also ARMC6 should not have compatibility issues but it will be good to test and confirm.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 13, 2019

@DanielDmlee What is the status for this PR? Based on the previous comments, all tests are passing and this is ready for review?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 13, 2019

@ashok-rao please review, we will as well soon

@DanielDmlee
Copy link
Contributor Author

@DanielDmlee - Thanks for the PR. We are slowly migrating to IAR 8.x and ARMC6 and will like to know if the binaries in this PR are compatible to IAR 7.x and IAR 8.x? Also ARMC6 should not have compatibility issues but it will be good to test and confirm.

@deepikabhavnani First of all, sorry for late replay. The GCC ARM linker script is correct. ARMCC and IAR are not correct so far. I need help to get them in.

@DanielDmlee
Copy link
Contributor Author

@DanielDmlee What is the status for this PR? Based on the previous comments, all tests are passing and this is ready for review?

@0xc0170 Has been completed Greentea test (include netsock and network), but linker scripts for ARMCC and IAR are not correct so far. I need help to get them in.

*mbed_boot*.o (+ZI)
}

ARM_LIB_STACK (0x10070000 - 0x1000) EMPTY 0x1000 {

Choose a reason for hiding this comment

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

Suggested change
ARM_LIB_STACK (0x10070000 - 0x1000) EMPTY 0x1000 {
ARM_LIB_STACK 0x10070000 EMPTY -0x1000 {

Choose a reason for hiding this comment

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

Also the stack size for Mbed 5 is 0x400. 0x1000 is needed for Mbed 2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deepikabhavnani Thank you for the review, I'll check your guide ASAP.

@@ -255,6 +255,7 @@ nsapi_error_t RTWInterface::disconnect()
return NSAPI_ERROR_DEVICE_ERROR;
}
while(1) {
wait(0.1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs own commit, explaining why is this wait needed here - a fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'm going to make own commit with explaining.

@@ -20,7 +20,9 @@
extern "C" {
#endif

#if CONFIG_ADC_EN
Copy link
Contributor

Choose a reason for hiding this comment

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

also a fix, should not be part of "adding a new target commit"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'm going to make a new commit

@@ -0,0 +1,42 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
Copy link
Contributor

Choose a reason for hiding this comment

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

new files should contain SPDX identifier (look at platform files for instance how to)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I understand. I'm going to update.

@@ -0,0 +1,229 @@
/*
* Copyright (c) 2013-2016 Realtek Semiconductor Corp.
Copy link
Contributor

Choose a reason for hiding this comment

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

year 2018-2019 here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'm going to modify.

@cmonr
Copy link
Contributor

cmonr commented Feb 26, 2019

@DanielDmlee Any updates?

@DanielDmlee
Copy link
Contributor Author

@DanielDmlee Any updates?

Yes, I'm still finding solution fo ARMCC and IAR.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2019

Note, #9571 - might have implications for new targets. Please review (there's design document, and targets updated, if any questions, let us know). In any case, please reply to this comment if this change is already done or when completed.

IAR8 used on master (8.32 to be specific), please consider this when updating IAR files in this PR.

@cmonr
Copy link
Contributor

cmonr commented Mar 19, 2019

@DanielDmlee Are there any available updates on this PR?

@DanielDmlee
Copy link
Contributor Author

@DanielDmlee Are there any available updates on this PR? @0xc0170

I'm trying fit to IAR8, ARM6, and 5.12 coming soon, so I'll update again after 5.12.

@adbridge
Copy link
Contributor

@DanielDmlee as 5.12 has been out for a while now, any planned updates for this PR ?

@DanielDmlee
Copy link
Contributor Author

DanielDmlee commented Apr 29, 2019

@DanielDmlee as 5.12 has been out for a while now, any planned updates for this PR?

@adbridge This is the current suspended state. As you can see at #9808, 8195 which is the big brother of 8710 is not supported IAR8 version yet. So has been removed 'release_versions' field of RTL8195AM at 'target.json' file. In this situation, can I 8710 push to 5.11.5 if prepared ARM v5.06 and IAR7 compiler?

@kissste
Copy link

kissste commented May 1, 2019

In this situation, can I 8710 push to 5.11.5 if prepared ARM v5.06 and IAR7 compiler?

Yes, please.

@adbridge
Copy link
Contributor

adbridge commented May 1, 2019

@DanielDmlee Sorry 5.11.5 is no longer a supported version (and we do not accept PRs directly to patch release branches by default).

@janjongboom
Copy link
Contributor

@adbridge So does this mean that 8195 is from now on unsupported and should be removed even though it's supported by two compilers?! In my opinion 8710 should be treated the same as 8195. Same board package.

@adbridge
Copy link
Contributor

adbridge commented May 7, 2019

@adbridge So does this mean that 8195 is from now on unsupported and should be removed even though it's supported by two compilers?! In my opinion 8710 should be treated the same as 8195. Same board package.

@bulislaw can you comment?

@bulislaw
Copy link
Member

8195 is not supported in Mbed starting 5.12 I believe (the release version 5 was removed from target description). As we extend our testing to cover more and more boards, we will be removing (or at least reclassifying) boards that fail testing or don't fulfil requirements like 3 compilers and are not fixed by the vendor in reasonable time. We hoped 8195 will be fixed by the vendor and we can reenable it in patch release, but that didn't happen yet. New boards won't be added if they don't pass testing on all 3 compilers.
I was thinking about having two tiers of boards in Mbed, officially supported known to be of good quality with good vendor support behind them and "partially supported" which may not support all compilers or not pass all tests or the vendor support may not be there.
@MarceloSalazar fyi

@DanielDmlee
Copy link
Contributor Author

Hi Folks, I will close this commit. If the 8195 does not support all of the compilers in 5.12, the 8710 can not use as well. I'll be monitoring 8195 status and open commit again.

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.