30 Replies Latest reply on Aug 16, 2019 1:03 PM by wizio

    Azure Sphere for PlatformIO

    wizio
        • Re: Azure Sphere for PlatformIO
          wizio

          ARDUINO - PlatformIO

           

          1 of 1 people found this helpful
          • Re: Azure Sphere for PlatformIO
            wizio

            Arduino: class wifiClient()  work ... need only solution for ioctl - rx available bytes

            LOG from uart Serial.println()

            Azure Sphere 2019 Georgi Angelov

            Arduino - Hello World - PlatformIO

            Azure Sphere MT3620 Starter AES-MS-MT3620-SK-G by Avnet

            Waithing wifi..

            [GET] Connecting wizio.eu

            [GET] Send  

            [GET] Receive

            HTTP/1.1 200 OK

            Date: Sat, 10 Aug 2019 07:38:56 GMT

            Server: Apache

            Upgrade: h2,h2c

            Connection: Upgrade, close

            Cache-Control: max-age=0

            Expires: Sat, 10 Aug 2019 07:38:56 GMT       

            Content-Length: 47

            Content-Type: text/html

            [WIZIO.EU] Hello World ( 2019-08-10 10:38:56 )

            [GET] DONE

            1 of 1 people found this helpful
            • Re: Azure Sphere for PlatformIO
              wizio

              Can anyone send me an ELF (out file) from a BareMetal project and/or verbose log from VS compiler - need gcc & linker settings

                • Re: Azure Sphere for PlatformIO
                  wizio

                  Libraries in bold...

                   

                   

                  #include <Arduino.h>

                   

                  #include <Wire.h>

                  #include <Adafruit_GFX.h>

                  #include <Adafruit_SSD1306.h>

                  Adafruit_SSD1306 display;


                  void TEST_OLED()

                  {

                    Serial.println("[APP] OLED TEST");

                    display.begin(SSD1306_SWITCHCAPVCC, 0x78 >> 1); // 7-bits

                    display.clearDisplay();

                    display.setTextSize(2);

                    display.setTextColor(WHITE);

                    display.setCursor(0, 0);

                    display.println(" Arduino");

                    display.setTextColor(BLACK, WHITE);

                    display.println(" Azure ");

                    display.println(" Sphere ");

                    display.setTextSize(1);

                    display.setTextColor(WHITE, BLACK);

                    display.println();

                    display.println(" WizIO 2019");

                    display.display();

                  }


                  void setup()

                  {

                    Serial.begin(115200);

                    Serial.println("\nArduino Azure Sphere 2019 Georgi Angelov");

                    TEST_OLED();

                  }


                  void loop()

                  {

                    Serial.println("[APP] LOOP");

                    delay(10000);

                  }

                  1 of 1 people found this helpful
                    • Re: Azure Sphere for PlatformIO
                      rdr91h

                      Very impressive your work in Platformio. I have run the two examples in the github repository and everything is ok, but when I try the the oled code, I don´t have the correct wire library, which one do you use?

                       

                      Thanks in advance

                      Roberto.

                        • Re: Azure Sphere for PlatformIO
                          wizio

                          Hi Roberto,

                          search in PIO-Home-Libraries for this and look author and versions

                           

                          and this OLED: https://store.comet.bg/Catalogue/Product/51127/

                           

                          name=Adafruit GFX Library

                           

                          version=1.5.5

                          author=Adafruit

                          maintainer=Adafruit <info@adafruit.com>

                          sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.

                          paragraph=Install this library in addition to the display library for your hardware.

                          category=Display

                          url=https://github.com/adafruit/Adafruit-GFX-Library

                          architectures=*

                           

                           

                          name=Adafruit SSD1306 128x64

                           

                          version=1.1.2

                          author=Adafruit

                          maintainer=Adafruit <info@adafruit.com>

                          sentence=SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs!

                          paragraph=SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs! Defaults to 128x64.

                          category=Display

                          url=https://github.com/JokerQyou/Adafruit_SSD1306_64

                          architectures=*

                          1 of 1 people found this helpful
                            • Re: Azure Sphere for PlatformIO
                              rdr91h

                              Hi Georgi,

                              thanks for your fast answer, I checked the libraries:

                               

                              name=Adafruit GFX Library

                              version=1.5.5

                              author=Adafruit

                              maintainer=Adafruit <info@adafruit.com>

                              sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from.

                              paragraph=Install this library in addition to the display library for your hardware.

                              category=Display

                              url=https://github.com/adafruit/Adafruit-GFX-Library

                              architectures=*

                               

                              name=Adafruit SSD1306 128x64

                              version=1.1.2

                              author=Adafruit

                              maintainer=Adafruit <info@adafruit.com>

                              sentence=SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs!

                              paragraph=SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs! Defaults to 128x64.

                              category=Display

                              url=https://github.com/JokerQyou/Adafruit_SSD1306_64

                              architectures=*

                               

                              But the problem is with the Wire.h, and SPI.h. I try to install the Wire library with platformio but it doesn´t appear in the search box. If a try to copy from the arduino libraries folder I get errors. This is the output without wire library

                              Processing avnet_aesms_mt3620 (platform: azure; board: avnet_aesms_mt3620; framework: arduino)

                              --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                              Verbose mode can be enabled via `-v, --verbose` option

                              <<<<<<<<<<<< AZURE SPHERE AES-MS-MT3620-SK-G 2019 Georgi Angelov >>>>>>>>>>>>

                              CONFIGURATION: https://docs.platformio.org/page/boards/azure/avnet_aesms_mt3620.html

                              PLATFORM: Azure Sphere 1.0.0 #81adc05 > Azure Sphere AES-MS-MT3620-SK-G

                              HARDWARE: ARM, MT3620 500MHz, 256KB RAM, 1MB Flash

                              DEBUG: Current (uart) On-board (uart)

                              PACKAGES: tool-azure 27c5242, framework-azure e5192e5, toolchain-arm-poky-linux-musleabi-hf 1.0.0

                              AZURE SPHERE SDK SYSROOT: 2 [ MT3620 ] avnet_aesms_mt3620

                              LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf

                              LDF Modes: Finder ~ chain, Compatibility ~ soft

                              Found 26 compatible libraries

                              Scanning dependencies...

                              Dependency Graph

                              |-- <Adafruit SSD1306 128x64> 1.1.2

                              |   |-- <Adafruit GFX Library> 1.5.5

                              |-- <Adafruit GFX Library> 1.5.5

                              Compiling .pio\build\avnet_aesms_mt3620\src\main.cpp.o

                              Compiling .pio\build\avnet_aesms_mt3620\liba7b\Adafruit GFX Library_ID13\Adafruit_GFX.cpp.o

                              Compiling .pio\build\avnet_aesms_mt3620\liba7b\Adafruit GFX Library_ID13\Adafruit_SPITFT.cpp.o

                              Compiling .pio\build\avnet_aesms_mt3620\liba7b\Adafruit GFX Library_ID13\glcdfont.c.o

                              src\main.cpp:5:10: fatal error: Wire.h: No such file or directory

                               

                              **************************************************************

                              * Looking for Wire.h dependency? Check our library registry!

                              *

                              * CLI  > platformio lib search "header:Wire.h"

                              * Web  > https://platformio.org/lib/search?query=header:Wire.h

                              *

                              **************************************************************

                               

                              #include <Wire.h>

                                        ^~~~~~~~

                              compilation terminated.

                              C:\Users\rober\.platformio\lib\Adafruit GFX Library_ID13\glcdfont.c:18:28: warning: 'font' defined but not used [-Wunused-const-variable=]

                              static const unsigned char font[] PROGMEM = {

                                                          ^~~~

                              *** [.pio\build\avnet_aesms_mt3620\src\main.cpp.o] Error 1

                              In file included from C:\Users\rober\.platformio\lib\Adafruit GFX Library_ID13\Adafruit_SPITFT.cpp:36:

                              C:\Users\rober\.platformio\lib\Adafruit GFX Library_ID13\Adafruit_SPITFT.h:25:10: fatal error: SPI.h: No such file or directory

                               

                              *************************************************************

                              * Looking for SPI.h dependency? Check our library registry!

                              *

                              * CLI  > platformio lib search "header:SPI.h"

                              * Web  > https://platformio.org/lib/search?query=header:SPI.h

                              *

                              *************************************************************

                               

                              #include <SPI.h>

                                        ^~~~~~~

                              compilation terminated.

                              *** [.pio\build\avnet_aesms_mt3620\liba7b\Adafruit GFX Library_ID13\Adafruit_SPITFT.cpp.o] Error 1

                              =============================================================================================== [ERROR] Took 4.37 seconds ========

                               

                               

                               

                               

                              And if I copy Wire and Spi from the arduino directory I get a lot of errors like this:

                               

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:146:65: error: 'DORD' was not declared in this scope

                                   spcr = _BV(SPE) | _BV(MSTR) | ((bitOrder == LSBFIRST) ? _BV(DORD) : 0) |

                                                                                               ^~~~

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h: In static member function 'static void SPIClass::beginTransaction(SPISettings)':

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:180:22: error: 'SREG' was not declared in this scope

                                     uint8_t sreg = SREG;

                                                    ^~~~

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:203:5: error: 'SPCR' was not declared in this scope

                                   SPCR = settings.spcr;

                                   ^~~~

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:204:5: error: 'SPSR' was not declared in this scope

                                   SPSR = settings.spsr;

                                   ^~~~

                              In file included from C:\Users\rober\.platformio\lib\Adafruit SSD1306 128x64_ID1513/Adafruit_SSD1306.h:48,

                                               from src\main.cpp:9:

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h: In member function 'void SPISettings::init_AlwaysInline(uint32_t, uint8_t, uint8_t)':

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:114:20: error: 'F_CPU' was not declared in this scope

                                     if (clock >= F_CPU / 2) {

                                                  ^~~~~

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:204:5: note: suggested alternative: 'PSTR'

                                   SPSR = settings.spsr;

                                   ^~~~

                                   PSTR

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h: In static member function 'static uint8_t SPIClass::transfer(uint8_t)':

                              C:\Users\rober\.platformio\packages\framework-azure\arduino\core/SPI.h:209:5: error: 'SPDR' was not declared in this scope

                               

                               

                              Thanks for your time.

                              Roberto

                                • Re: Azure Sphere for PlatformIO
                                  wizio

                                  you use old port ... not have SPI.... lib ask for SPI but is ised I2C

                                  goto C:\Users\USER_NAME\.platformio\platforms   delete folder azure

                                  goto C:\Users\USER_NAME\.platformio\packages   delete folder framework-azure

                                  and install platform  again - this is fast reinstall

                                  https://github.com/Wiz-IO/platform-azure#platform-installation

                                   

                                  then open your project INI and add

                                   

                                  build_flags = -D SSD1306_128_64

                                   

                                  or open Adafruit_SSD1306.h and redefine SSD1306_128_64 .... line 70

                                    • Re: Azure Sphere for PlatformIO
                                      rdr91h

                                      Hi,

                                      thank you, now the Wire errors has gone, but now I received some warnings and a new error.

                                       

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o: in function `deviceTwinChangedHandler':

                                      device_twin.c:(.text+0x550): undefined reference to `terminationRequired'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x8): undefined reference to `userLedRedFd'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x20): undefined reference to `userLedGreenFd'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x38): undefined reference to `userLedBlueFd'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x50): undefined reference to `appLedFd'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x68): undefined reference to `wifiLedFd'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x80): undefined reference to `clickSocket1Relay1Fd'

                                      C:/Users/rober/.platformio/packages/toolchain-arm-poky-linux-musleabi-hf/real-ld.exe: .pio\build\avnet_aesms_mt3620\src\device_twin.c.o:(.data.rel+0x98): undefined reference to `clickSocket1Relay2Fd'

                                      collect2.exe: error: ld returned 1 exit status

                                      *** [.pio\build\avnet_aesms_mt3620\app.elf] Error 1

                                      =============================================================================================== [ERROR] Took 4.33 seconds =============================================================================================== 

                                      El proceso del terminal finalizó con el código de salida: 1

                                       

                                      Las tareas reutilizarán el terminal, presione cualquier tecla para cerrarlo.

                                       

                                      Thanks in advanced.

                                      Roberto

                          • Re: Azure Sphere for PlatformIO
                            wizio

                            Let`s #azure #sphere #blynk https://blynk.io/

                             

                            1 of 1 people found this helpful
                            • Re: Azure Sphere for PlatformIO
                              wizio

                              Azure Sphere Arduino Speed Test https://github.com/PaulStoffregen/CoreMark

                               

                              Test with GCC Optimization -O0

                               

                              ( EDIT image is removed - "wrong test")

                               

                              > Executing task in folder CoreTest: platformio.exe device monitor <

                               

                              --- Miniterm on COM10  9600,8,N,1 ---

                              --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

                              CoreMark Performance Benchmark

                               

                              CoreMark measures how quickly your processor can manage linked

                              lists, compute matrix multiply, and execute state machine code.

                               

                              Iterations/Sec is the main benchmark result, higher numbers are better

                              Running.... (usually requires 12 to 20 seconds)

                               

                              2K performance run parameters for coremark.

                              CoreMark Size    : 666

                              Total ticks      : 14286

                              Total time (secs): 14.29

                              Iterations/Sec   : 279.99

                              Iterations       : 4000 

                              Compiler version : GCC8.2.0

                              Compiler flags   : (flags unknown)

                              Memory location  : STACK

                              seedcrc          : 0xE9F5

                              [0]crclist       : 0xE714

                              [0]crcmatrix     : 0x1FD7

                              [0]crcstate      : 0x8E3A

                              [0]crcfinal      : 0x65C5

                              Correct operation validated. See README.md for run and reporting rules.

                              CoreMark 1.0 : 279.99 / GCC8.2.0 (flags unknown) / STACK

                              3 of 3 people found this helpful
                              • Re: Azure Sphere for PlatformIO
                                wizio

                                on Cortex-A7, Arduino application ( Posix HighLevel )

                                1 of 1 people found this helpful
                                • Re: Azure Sphere for PlatformIO
                                  wizio

                                  CORRECTIONS - GCC Optimizations -Os = CoreMark 1.0 : 966.35

                                  (the first result is on -O0)

                                   

                                   

                                  --- Miniterm on COM10  9600,8,N,1 ---

                                  --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

                                  CoreMark Performance Benchmark

                                   

                                   

                                  CoreMark measures how quickly your processor can manage linked

                                  lists, compute matrix multiply, and execute state machine code.

                                   

                                   

                                  Iterations/Sec is the main benchmark result, higher numbers are better

                                  Running.... (usually requires 12 to 20 seconds)

                                   

                                   

                                  2K performance run parameters for coremark.

                                  CoreMark Size    : 666

                                  Total ticks      : 11383

                                  Total time (secs): 11.38

                                  Iterations/Sec   : 966.35

                                  Iterations       : 11000  

                                  Compiler version : GCC8.2.0

                                  Compiler flags   : (flags unknown)

                                  Memory location  : STACK

                                  seedcrc          : 0xE9F5

                                  [0]crclist       : 0xE714

                                  [0]crcmatrix     : 0x1FD7

                                  [0]crcstate      : 0x8E3A

                                  [0]crcfinal      : 0x33FF

                                  Correct operation validated. See README.md for run and reporting rules.

                                  CoreMark 1.0 : 966.35 / GCC8.2.0 (flags unknown) / STACK

                                  1 of 1 people found this helpful
                                  • Re: Azure Sphere for PlatformIO
                                    wizio

                                    -Ofast = CoreMark 1.0 : 1425.31

                                     

                                    2K performance run parameters for coremark.

                                    CoreMark Size    : 666

                                    Total ticks      : 14032

                                    Total time (secs): 14.03

                                    Iterations/Sec   : 1425.31

                                    Iterations       : 20000

                                    Compiler version : GCC8.2.0

                                    Compiler flags   : (flags unknown)

                                    Memory location  : STACK

                                    seedcrc          : 0xE9F5

                                    [0]crclist       : 0xE714

                                    [0]crcmatrix     : 0x1FD7

                                    [0]crcstate      : 0x8E3A

                                    [0]crcfinal      : 0x382F

                                    Correct operation validated. See README.md for run and reporting rules.

                                    CoreMark 1.0 : 1425.31 / GCC8.2.0 (flags unknown) / STACK

                                    4 of 4 people found this helpful
                                      • Re: Azure Sphere for PlatformIO
                                        peterfenn

                                        Georgi

                                         

                                        Thanks for repeating that benchmarking exercise with this optimization.

                                         

                                        To summarize...

                                        • 5x CoreMark improvement after changing GCC compiler optimization switch from -Os (score = 280) to -Ofast (score = 1425)
                                        • The single core 600 MHz M7F in Teensy 4.0 delivers impressive speed, but it lacks some key features that are built-into Azure Sphere
                                          eg.
                                          - Sphere's advanced security features (in silicon, in the OS, plus 13 years of OTA updates)
                                          - Dual-band Wi-Fi connectivity (with support for antenna diversity)
                                          - Multiple cores (1x 500MHz A7, 2x 200MHz M4F cores)  

                                        PS: Can you perhaps update the comparison chart?

                                         

                                        -Peter

                                      • Re: Azure Sphere for PlatformIO
                                        wizio

                                        Little experiment

                                         

                                        Azure Sphere - Wiring ( Arduino ) MT3620 Cortex-M4

                                        https://youtu.be/bdG8GsRaUSA 

                                         

                                        .... but need more info about register bits ...

                                        1 of 1 people found this helpful