PINE64

Full Version: ARM mbed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've read multiple times that ARM mbed is to be supported, but I found no news of progress (or if it's done). Is this still being worked on?
as far as mbed hardware platforms go, this is the most complete list i have read,
https://os.mbed.com/platforms/
why the padi is not listed is anybody's guess.
Try this link: https://os.mbed.com/platforms/Realtek-RTL8195AM/

The PADI is a RTL8710AF, but based on my understanding this is just a cut down version of the RTL8195AM. They seem to use the same SDK for Arduino and GCC so you can probably use the ARM mbed environment by setting the target to the RTL8195AM chip. That said the RTL8710AF does not support all the features of the full chip and you may have to modify the config file slightly.
There is a pull in mbed's github that does add support for RTL8710AF target (PADI IoT Stamp).

I have been playing with it, trying to get it working for a while and finally managed to get mbed-os-example-wifi working last night.

I will post more information.

Issues that needed to be addressed:
1/ Compiler has to be an old GCC ARM 4.8.3 (current version 6.3.1 will compile, but PADI will crash immediately, I gave v5.4.1 try too, which somewhat works, but still crashes, maybe when certain ROM functions are called...)
2/ mbed generates a binary file for CMSIS-DAP mass storage upload DAPLINK - which, unless you have got the right adapter, won't work. I had to build an image that can be used with JTAG/SWD uploading method using OpenOCD/ JLink.
(10-04-2018, 01:30 PM)kissste Wrote: [ -> ]There is a pull in mbed's github that does add support for RTL8710AF target (PADI IoT Stamp).

I have been playing with it, trying to get it working for a while and finally managed to get mbed-os-example-wifi working last night.

I will post more information.

Issues that needed to be addressed:
1/ Compiler has to be an old GCC ARM 4.8.3 (current version 6.3.1 will compile, but PADI will crash immediately, I gave v5.4.1 try too, which somewhat works, but still crashes, maybe when certain ROM functions are called...)
2/ mbed generates a binary file for CMSIS-DAP mass storage upload DAPLINK - which, unless you have got the right adapter, won't work. I had to build an image that can be used with JTAG/SWD uploading method using OpenOCD/ JLink.

Glad that you have make the mbed OS works on PADI IoT stamp.

Please share more of your experience and post more info. Thanks.
Mbed OS folks are in the process of refactoring REALTEK_RTL8195AM into MCU_ target and then PINE/RTL8710AF will inherit/ extended that.

https://github.com/ARMmbed/mbed-os/pull/...-427923144

It should go into 5.11.0-rc1 which will then need a patch.

My experiment were on the (current mbed-os-5.9 - might be previous at this time) master plus pull 7965 (which will have to be refactored as a result of pull 8266)
https://github.com/ARMmbed/mbed-os/pull/7965

[email protected]:~/mbed-os-example-wifi/mbed-os$ git branch
mbed-os-5.9
* pr-7965


Installation steps:
1/ Fetch Mbed OS master

2/ Apply pull 7965
git fetch origin pull/7965/head:pr-7965
git checkout pr-7965

3/ set env
mbed config target REALTEK_RTL8710AF
mbed toolchain GCC_ARM
mbed config GCC_ARM_PATH /home/steve/.arduino15/packages/realtek/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/

4/ Install Ameba 2.0.5 for Arduino or SDK 3.4, 3.5 or 4.0 - what we need is 4.8.3 gcc compiler

5/ Install pvvx's rtlaimage.py, from his RTLDUINO project

6/ openocd/ jlink flash write tools from one of pvvx's RTL8710 projects

7/ Modifications to mbed-os:

os-example-wifi$ mbed status

[mbed] Status for "mbed-os":
M targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8XXXA/device/TOOLCHAIN_GCC_ARM/TARGET_RTL8710A/rtl8710a.ld
M targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8XXXA/device/TOOLCHAIN_GCC_ARM/rtl8195a_rom.h
M targets/targets.json
M tools/targets/REALTEK_RTL8195AM.py

7/ Modification to rtlaimage.py - add mbed sections/obj names.

Building and running:
a/ mbed compile

b/ generate compatible images
python rtlaimage.py -r -a -o ./ ~/mbed-os-example-wifi/BUILD/REALTEK_RTL8710AF/GCC_ARM/mbed-os-example-wifi.elf

c/ upload - ram, or to image2 or ota
./JLink-RunRAM.sh
or
./JLinkGDB_OTA.sh
or....

Status:
Sometimes it runs fine, sometime freezes when running on the chip, not sure why, might be running at 166MHz (RTL8195 setup) instead of standard (for RTL8710) 83MHz. I have got HT7333 regulator and 1000uF capacitor (power should be OK).
(10-08-2018, 03:32 PM)kissste Wrote: [ -> ]Mbed OS folks are in the process of refactoring REALTEK_RTL8195AM into MCU_ target and then PINE/RTL8710AF will inherit/ extended that.

https://github.com/ARMmbed/mbed-os/pull/...-427923144

It should go into 5.11.0-rc1 which will then need a patch.

My experiment were on the (current mbed-os-5.9 - might be previous at this time) master plus pull 7965 (which will have to be refactored as a result of pull 8266)
https://github.com/ARMmbed/mbed-os/pull/7965

[email protected]:~/mbed-os-example-wifi/mbed-os$ git branch
 mbed-os-5.9
* pr-7965


Installation steps:
1/ Fetch Mbed OS master

2/ Apply pull 7965
git fetch origin pull/7965/head:pr-7965
git checkout pr-7965

3/ set env
mbed config target REALTEK_RTL8710AF
mbed toolchain GCC_ARM
mbed config GCC_ARM_PATH /home/steve/.arduino15/packages/realtek/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/

4/ Install Ameba 2.0.5 for Arduino or SDK 3.4, 3.5 or 4.0 - what we need is 4.8.3 gcc compiler

5/ Install pvvx's rtlaimage.py, from his RTLDUINO project

6/ openocd/ jlink flash write tools from one of pvvx's RTL8710 projects

7/ Modifications to mbed-os:

os-example-wifi$ mbed status

[mbed] Status for "mbed-os":
M targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8XXXA/device/TOOLCHAIN_GCC_ARM/TARGET_RTL8710A/rtl8710a.ld
M targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8XXXA/device/TOOLCHAIN_GCC_ARM/rtl8195a_rom.h
M targets/targets.json
M tools/targets/REALTEK_RTL8195AM.py

7/ Modification to rtlaimage.py - add mbed sections/obj names.

Building and running:
a/ mbed compile

b/ generate compatible images
python rtlaimage.py -r -a -o ./ ~/mbed-os-example-wifi/BUILD/REALTEK_RTL8710AF/GCC_ARM/mbed-os-example-wifi.elf

c/ upload - ram, or to image2 or ota
./JLink-RunRAM.sh
or
./JLinkGDB_OTA.sh
or....

Status:
Sometimes it runs fine, sometime freezes when running on the chip, not sure why, might be running at 166MHz (RTL8195 setup) instead of standard (for RTL8710) 83MHz. I have got HT7333 regulator and 1000uF capacitor (power should be OK).

thanks on the write up. May be due to ruuunig at 166Mhz as you stated. Anyway lowering back to 88MHz?
Update: No luck so far.

This is the example, that I'm trying to run:
https://github.com/ARMmbed/mbed-os-examp...r/main.cpp

Steps:
A/ prints to console
B/ inits wifi
C/ scans wifi
D/ connects to wifi

I have tried multiple bootloaders that I have found (there are versions out there, have not tried all of them yet).

Based on the latest one, which sets CPU clock to 83.333Mhz before jump to the image, the problem might be in mbed's generated code (need to dig there).

1/ mbed's RTL8195 supplied bootloader
- partition signature is OK, jumps there and freezes, to even console output

2/ RTL's SDK4.0a GCC supplied bootloader
- partition signature is OK, jumps there and prints to console (A), inits wifi (B) and freezes on scan © but managed to output sometimes.

3/ PVVX's RTL00MP3 github repo and RTL00_WEB github repo
- partition signature is OK, jumps there and prints to console (A), freezes wifi (B), sometimes gets to © but ever rarely output scan results
- one of these bootloaders explicity set 83.333MHz CPU freq and calibrates/populates calibrated SPI params.

What PVVX wrote on the subject of bootloader (in russian, use google translate):
https://esp8266.ru/forum/threads/rtl871x...ader.2142/

P.S.1: I have tried multiple PADI's just in case trouble is with hardware,

P.S.2: Interesting (found out by an accident): Lowering voltage to 3.1xV from 3.30V appears to makes it running longer. This indicates - again clock speed.

P.S.3: I might have not mentioned before: Compiler has to be from gcc-arrm-none-eabi version 4.8.3
but!! GDB must be from a recent gcc-arm-non-eabi version otherwise openocd flasher from SDK4.0 error's out and won't flash...
github's DanielDmlee has refactored the patch to work with a separation of board vs MCU (RTL8710/PADI inherits from MCU instead of a board.)

https://github.com/ARMmbed/mbed-os/pull/7965

I have not had a change to give it a try, I expect it to work as previously was.

I'm looking forward to "'how to using 'JLink adapter+JLinkExe'", below:
https://github.com/ARMmbed/mbed-os/pull/...-431240228

In respect to which bootloader to use: I have not had a chance to try more of them/ and more systematically.



> How much space is left on the device for usage?

Given that CM3 does not have XIP (eXecute in Place), your program code (plus chunky RTL libraries that we have got only binaries for), and ram for variables, and other memory allocated on the fly, is taking the same RAM area that is available.

from .ld file:
SRAM1 (rwx) : ORIGIN = 0x10006000, LENGTH = 0x10070000 - 0x10006000

for some reason, the mbed .ld file gives up more RAM (4k)
SRAM1 (rwx) : ORIGIN = 0x10007000, LENGTH = 0x10070000 - 0x10007000

P.S. Boot loader and RAM that ROM functions use goes here:
DATA_RAM (rwx) : ORIGIN = 0x10002100, LENGTH = 0x10006000 - 0x10002100

or (mbed's ld file)
DATA_RAM (rwx) : ORIGIN = 0x10002100, LENGTH = 0x10007000 - 0x10002100

Back for how much...
Theoretically available, but to 100% sure, there might be something at the end of this range), anyway:
458,752 (0x70000) - 28,672 (0x07000) = 430,808

and the mbed-wifi example's generated binary is 349,480.

Then on top of it whatever LWIP, and RTL's libraries allocated.
(11-03-2018, 08:11 PM)kissste Wrote: [ -> ]github's DanielDmlee has refactored the patch to work with a separation of board vs MCU (RTL8710/PADI inherits from MCU instead of a board.)

https://github.com/ARMmbed/mbed-os/pull/7965

I have not had a change to give it a try, I expect it to work as previously was.

Given that CM3 does not have XIP (eXecute in Place), your program code (plus chunky RTL libraries that we have got only binaries for), and ram for variables, and other memory allocated on the fly, is taking the same RAM area that is available.
Aren't those blobs in source form in the realtec SDK distributed with the PADI? Or are they different?
As for installing, I haven't given it a try yet. Might it be better to wait till its pulled up? Would you like to write a how-to about installing etc.? Maybe we can use the current SDK as base for the GCC compiler? This removes yet-another dependency on say Arduino/Rtlduino etc.
Pages: 1 2