Giter VIP home page Giter VIP logo

smingrtos's Introduction

Sming_RTOS Beta version

!!! Warning: This project is no longer mainained. You can take a look at the original Sming project which is actively developed. !!!

Sming based on Espressif RTOS SDK.

Based on: Sming Develop, including commits until Sming 2.1.0 release Based on: Espressif RTOS_SDK 1.3.0 Build

Feedback:

  • When finding issues during conversion of applications -> Submit an issue on the Sming_RTOS repository.

Requirements:

  • Espressif RTOS_SDK 1.3.0
  • UDK 2.0.9 for toolchain and SDK on Windows or esp-open-sdk on Linux
    • Be sure to have a "clean" sdk without previously applied updates
  • esp-alt-sdk provides downloads for all platforms, @kireevco to supply links

Usage:

  • Beware : Some Environment variables names are identical to SMING_NONOS !

  • Clone this repository.

  • SET environment variables valid for the location

  • Set SDK location in Makefile- or as environment variables -> SDK_BASE = ....

  • Set WIFI_SSID & WIFI_PWD in environment variables

  • Compile & flash

Additional needed software

Completeness:

  • All Core and Network functionality is ported to Sming_RTOS
  • Spiffy & Spiffs Filesystem functionality included

Applications:

  • Application which includes HttpAjax & HWPwm example source.
  • HttpAjax -> works
  • HWPWm, -> compiles, not tested on hardware
  • Neopixel -> working
  • ScannerI2C -> working
  • WebSockets -> working
  • SDCard -> working
  • HCSR04 Ultrasonic -> working
  • DHT11-22 -> DHT11 tested and working , DHT22 untested
  • SSD1306 Screen -> i2c module tested and working, spi module untested
  • DS1820 -> working
  • SystemClock&NTP -> working
  • BMP180 Pressure -> working
  • RBoot -> working
  • PCD8544 LCD (Nokia 5110 LCD) -> working

Known RTOS/NONOS differences with application consequences

Generic :

  • No WDT routines
  • Soft timer only on milli and not on micro level

SPI_SIZE

  • The espressif SDK is more restrictive on use of flash The SPI_SIZE needs to be set correct to prevent issues (especially Spiffs)

Include files :

  • The user_config.h file does not contain any framework includes anymore. -> Remove the NONOS user_config.h ! If not removed, there will be unresolved .h files
  • The directory structure has changed. The only include necessary is the #include "SmingCore.h" When using libraries use #include "libraries/......" For case sensitive systems : beware of naming

Spiffs

  • Spiffs FS'es created on NONOS are not supported -> Create a new spiffs using the RTOS supplied Spiffy !
  • When mounting the FS on Flash is checked for "Generic spiffy structure" (blocksize, FS length,..)
  • spiffs_mount() and spiffs_mount_manual return bool based on mount result
  • When using spiffs_mount() the size of the spiffs FS is autodetected.
  • When using spiffs_mount_manual()
    • use the actual flash address : For conversion of current spiffs_mount_manual : subtract 0x40200000 from start address
    • use filesize is 0 (zero) for autodetected size of FS
  • See the remark above on SPI_SIZE. If set not correct the spiffs_mount and spiffs_mount_manual will fail. rBoot
    • Works as in Sming but ... See the above on spiffs_mount_manual !

HardwarePWM. - Duty cycle is now independent on period. - Values are from 0 - 1023

smingrtos's People

Contributors

alon24 avatar alonewolfx2 avatar avr39-ripe avatar flexiti avatar happycodingrobot avatar harry-boe avatar hreintke avatar johndoe8967 avatar patrickjahns avatar ptdreamer avatar raburton avatar slaff avatar zardam avatar zendes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smingrtos's Issues

Naming of samples

The naming of the samples is not very consistent.

@alonewolfx2 : Can you think on what convention we can use and update the samples accordingly ?
Beware that naming is nor only in the 'directory name' but also in the .project and .project files for eclipse.

Flash Address Fix & Remove 0x3000 flash gap

Richard,
I pushed a branch with two updates :

  • Remove the 0x3000 flash gap in spiffs_sming.c & makefile-project
  • Remove the use of flashaddresses which have added the 0x40200000 start of irom0.

Updated the basic_rboot example to use this new addresses but did not test all options.

Do you agree with this one going into SmingRTOS -> I will add a note on this on the "convesion page"

esp_systemapi

@raburton :
In your "libsming PR" you commented out the lines below
//extern void *pvPortMalloc(size_t xWantedSize, const char *file, uint32 line);
//extern void vPortFree(void *ptr, const char *file, uint32 line);

In my dev environment that prevents rboot-api.c to compile.
For that I need them to be in.

Any specific reason for you to get the out ?

Main Makefile only for Win$

1).Main Makefile of Sming_RTOS_POC is written only to support Win$. It does NOT include "guess the OS magic" used in original Sming.
Env variables working FOR ME:
BIN_HOME=/opt/ESP8266_RTOS_SDK/bin/
ESP_HOME=/opt/esp-open-sdk/
SMING_HOME=/opt/ESP_RTOS_POC/
SDK_BASE=/opt/ESP8266_RTOS_SDK/

With directory structure: /opt/
drwxr-xr-x 10 laurent laurent 4096 01-01 20:00 ESP8266_RTOS_SDK
drwxr-xr-x 10 laurent laurent 4096 01-01 20:53 esp-open-sdk
drwxr-xr-x 9 laurent laurent 4096 10-24 21:11 Espressif
drwxr-xr-x 4 laurent laurent 4096 01-01 17:24 ESP_RTOS_examples
drwxr-xr-x 15 laurent laurent 4096 01-01 19:47 ESP_RTOS_POC
drwxr-xr-x 46 laurent laurent 4096 01-01 19:32 Sming

2). missing ESPTOOL2 (in esp-open-sdk there is esptool.py which did NOT worked for me).

Linux Fedora 16 @ i386 (!64)

mqtt.commandProcessing()?

Hello

What does

mqtt.commandProcessing(true,"command","cmdreply")

on line 76 in the sample MqttClient_Hello exactly?

Thanks

Spiffy start address calculation

Can be that this issue is generic and not rtos sdk specific.

I have two example applications both use spiffs with a spiffy generated fs.

  • httpserver_ajax
    runs OK. flash output :
Writing at 0x00052000... (98 %) 
Writing at 0x00052400... (98 %) 
Writing at 0x00052800... (99 %) 
Writing at 0x00052c00... (99 %) 
Writing at 0x00053000... (100 %) 
Written 300032 bytes in 29.61 seconds (81.05 kbit/s)...
Erasing flash...
head:  12 ;total: 128
erase size :  475136

Writing at 0x00054000... (0 %) 
Writing at 0x00054400... (0 %) 
Writing at 0x00054800... (0 %) 
Writing at 0x00054c00... (0 %) 
Writing at 0x00055000... (0 %) 
  • CommandProcessing_Debug
    Fails to start (continuous reset)
    flash output :
Writing at 0x00052c00... (98 %) 
Writing at 0x00053000... (98 %) 
Writing at 0x00053400... (98 %) 
Writing at 0x00053800... (99 %) 
Writing at 0x00053c00... (99 %) 
Writing at 0x00054000... (100 %) 
Written 304128 bytes in 29.96 seconds (81.20 kbit/s)...
Erasing flash...
head:  12 ;total: 128
erase size :  475136

Writing at 0x00054000... (0 %) 
Writing at 0x00054400... (0 %) 
Writing at 0x00054800... (0 %) a
Writing at 0x00054c00... (0 %) 

When building commandoutput with DISABLE_SPIFFS it starts OK, (no resets)
It obviously fails when accessing spiffs as it is not flashed with this setting.

To me it looks like a miscalculation of spiffs start address in spiffy.
Any other thought ? If you think it is not I will further investigate into framework calculation of start address and/or other

UPDATE : When locating the spiffs fs manually on another location on the flash and mounting with a spiffs_mount_manual() it runs OK

UPDATE 2 : Flash code end as used by framework : _flash_code_end:402545ae

rBoot RTC integration

@raburton :

I restarted working on a rBootClass within SmingRTOS, now including your latest update with use of RTC for temp booting.
In order to facilitate that I need to check/access the rBoot RTC data within the rBootClass.
For that I would need to have the option BOOT_RTC_ENABLED within the framework -> added #define BOOT_RVC_ENBLED to sming\include\sming_config.h
Compiles & links unchanged (= not using RTC functions) framework and application OK.

Then including RTC function within rBootClass :

    rboot_rtc_data rbootRTC;

    if (!rboot_get_rtc_data(&rbootRTC))
    {
        commandOutput->printf("No valid rBoot RTC data \r\n");
    }
    else
    {
        commandOutput->printf("rBoot RTC = Next mode : %d, Last mode : %d, Last rom : %d, Temp rom %d\r\n",rbootRTC.next_mode,rbootRTC.last_mode,rbootRTC.last_rom,rbootRTC.temp_rom);
    }

Framework compiles OK, application compiles OK but link errors -> undefined reference to rboot_get_rtc_data

I expected that I had to include compiling rboot-api.c with the framework -> added MODULES += rboot/appcode to the makefile.
But then I hit an "old issue" we had earlier while converting to SmgRTOS ->

rboot/appcode/rboot-api.c:16:22: error: implicit declaration of function 'pvPortMalloc' [-Werror=implicit-function-declaration]
 #define os_malloc(s) pvPortMalloc(s)
                      ^

The work in progress (far from complete) is in the RBootClass branch.

Could you check this and maybe point to a direction/way to solve ?

PS : I did not squash the commit so you can see the last update I did.

rboot_write_flash : writing final extra bytes

@raburton :
I am implementing a "FlashStream" as a way to write raw data to flash without using the filesystem.
Usage within Sming will be the possibility to push (OTA) application/ spiffs FS using HTTP upload, but of course can then be used for any other purpose.
As function to write to the flash I intend to use the rboot_write_flash, as it already takes care of erasing and alignment of 4 bytes.

Checking the functionality, I did not see the possibility to write as a last action the remaining "extra bytes" from the rboot_write_status.
Did I overlook this or needs this still to be implemented ?

Initial issues

Made a PR for compiling on Linux, but still got issues...

  1. Missing libs microc & microgcc
  2. If I add these from Sming I get error: multiple definition of 'abort'
  3. Missing linker script

Sample app for storing configuration settings

I have been using HttpServer_ConfigNetwork as a sample app for reference on how to store configuration settings on SMING NONOS. For SmingRTOS, HttpServer_ConfigN etwork app is missing. Which is the closest sample app in SmingRTOS that I can use as reference on how to store configuration settings?

RTOS LWIP compile

@ADiea @raburton :
I have an issue on RTOS with webservers servicing a large number of requests (stop serving pages).
For investigating this further I would need to have LWIP in debug mode.
Asking Espressif on that I get the reply :

LWIP is open source on ESP8266_RTOS_SDK_V1.4.0.

You can enable the debug mode yourself if it is needed.

Thanks for your interest in ESP8266 !

I lack the knowledge to be able to compile the LWIP from the sources available in the SDK.

Can you help me getting this done so I can continue to trace down the Sming issue ?

Make sming namespace aware

If somebody wants to integrate SmingRTOS with another libraries lets say google protobuf, adding sources of googleprotobuf to app folder results in double declarations or symbol clash - for example symbol
pb (defined as portb in arduino part of sming),
and
pb as protobuf from google protobuf sources

As result of that one could not build such firmware.

Maybe making sming namespace aware could solve this?

OTA with a single slot?

I am trying to determine if it would be possible to implement a single-slot OTA. I would like to use rBoot with a single ROM slot and the code would d/l an update to flash, directly over the current one. That doesn't work. I tried moving the ota_callback routine to RAM with IRAM_ATTR to avoid messing up the callback during the transfer, but it doesn't seem to help. Is there a different way to do this?

I can think of 2 workarounds:

  • create a small 2nd slot and populate it with a small OTA routine to do the upgrade. Boot from it, and then revert to the other ROM afterwards.
  • an HTTP download of the new ROM which could then be copied to flash at the correct location

thoughts?

Remove this line to get MqttClient_Hello to work

I tried out the sample app MqttClient_Hello. At first, ESP8266 keeps resetting itself. To finally get it to work, the following line in init() has to be commented out.

commandHandler.registerSystemCommands();

I am not sure why exactly. Perhaps the experts can advise.

Ease of porting from Sming to SmingRTOS

I just ported the small DNSServer addition and find it quite cumbersome do provide functionality for both SMING and SmingRTOS.
Some things to drip over is for example the naming convention i.e. lower case ../wiring/Wstring.h (RTOS) and upper case ../Wiring/Wstring.h (NONOS). Can we streamline the naming conventions for both projects?

Best case scenario would be, if the structure of both projects is the same - then it would be most easy to provide patches for both (for example security/problem related patches).

I know SMING will be deprecated and SmingRTOS is supposed to continue from there on. The structure of SmingRTOS has changed quite some and actually it would be great if SmingRTOS could still be a "drop-in-replacement" with as few changes as needed.

Any thoughts on this?

Problem compiling an example (Basic_Serial) on Linux (x86_64)

Hi,

Before reading further, please keep in mind that I'm really new at this.

What is the correct procedure (starting from scratch) to compile a sample application? Let's say I'm interested in the Basic_Serial.

Steps that I have followed:

  • Clone the esp-open-sdk:
    git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
  • Build the esp-open-sdk as non-standalone (after changing the Makefile to fetch the 1.3.0 version, however, I do believe that this is irrelevant since esp-open-sdk build process appears to fetch the NONOS SDK anyway):
    make STANDALONE=n
  • Clone the Espressif RTOS SDK (I'm quite sure that this is where things went wrong, since I'm not sure whether this actually clones the RTOS 1.3.0 which is mentioned in the readme for this repo):
    git clone https://github.com/espressif/ESP8266_RTOS_SDK.git --branch 1.3.x --single-branch
  • Clone the SmingRTOS:
    git clone https://github.com/SmingHub/SmingRTOS.git
  • Set up some environment variables:
export ESP_HOME="/home/kom/esp/esp-open-sdk/"
export SDK_BASE="/home/kom/esp/ESP8266_RTOS_SDK/"
export SMING_HOME="/home/kom/esp/SmingRTOS/sming/"
  • Build the libsming:
    cd $SMING_HOME && make
    Problem 1: JsonVariant.cpp is referring to errno.h that no longer exists, uncommenting line 13 and commenting line 12 seems to fix it
  • Build the example:
    cd $SMING_HOME/../samples/Basic_Serial/ && make:
C+ app/application.cpp
AR out/build/app_app.a
LD out/build/app.out
/home/kom/esp/ESP8266_RTOS_SDK//lib/libmain.a(app_main.o): In function `user_init_task':
(.irom0.text+0x580): undefined reference to `user_rf_cal_sector_set'
/home/kom/esp/ESP8266_RTOS_SDK//lib/libmain.a(app_main.o): In function `flash_data_check':
(.irom0.text+0x655): undefined reference to `user_rf_cal_sector_set'
collect2: error: ld returned 1 exit status
/home/kom/esp/SmingRTOS/sming//Makefile-project.mk:287: recipe for target 'out/build/app.out' failed
make: *** [out/build/app.out] Error 1

What did I miss? Am I using incorrect RTOS SDK version? Adding code from here to user_main.cpp seems to fix the build issue, is this the correct way of solving this? If so, why hasn't this been submitted to the repo?

My apologies if the formatting is less-than-ideal - this is my first message on GitHub ever!

Karolis

Document the rtos fragile stack handling

Many of the issues reported in gitter in the past days related to stack/heap issues in using SMING rtos.

I think it would be a good idea to put this information either in a README or WIKI page so people know what they are dealing with when porting their code to SMING RTOS

using more program space with 4m flash?

Please excuse if this is a stupid or frequently asked question - I'm new to both SmingRTOS and GitHub :-)

First of all many thanks to everyone who contributed to SmingRTOS!

I'm using UDK 1.0 beta on windows (should be ESP8266_RTOS_SDK 1.40). Everything I tried seems to work fine after changing some sdk paths in Makefile-project.mk. However, after enabling WPS I soon ran out of program memory:

ld.exe: region `irom0_0_seg' overflowed by ... bytes

SmingRTOS seems to use the larger flash memory of 4M devices for SPIFFS only. So I tried to change eagle.app.v6.hr.ld:

irom0_0_seg : org = 0x4020A000, len = 0xF0000

This way I was able to compile run a simple test program using WPS. However, for bigger programs the EPS8266 now crashes on boot-up, like the the flash memory is corrupted somehow.

Is there a way to configure SmingRTOS to use more flash memory for program space? It would be great if one could choose between different common flash memory layouts ...

Thanks for any help!

How to migrate from Non-OS Sming to RTOS Sming in Windows?

I have deleted Non-OS Sming and replaced with RTOS in Sming directory, then deleted ESPressif\sdk and Created directory link to ESP8266_RTOS_SDK directory, then rebuilt index, build all. Unfortunately, I have problem with all the applications. Please someone write an instruction to ease the migration from Sming Non-OS.

TCPConnection RTOS Task

It's more to a question than an issue. And I haven't looked at the source code. Hopefully I can get a better explanation from you guys.

My question is whether the execution of TCPConnection or network connection and data receiving in general is within a RTOS task? If so, how can I configure task's heap size and priority?

Thanks!

JsonObjectStream does not allow a JsonArray as root node

JsonObjectStream currently sets rootnode to JsonObject within the constructor. So it cannot be used if an JsonArray is required as root node.

A possible solution would be either a second constructor or a new class, e. g. JsonArrayStream.

undefined reference m_printf

in esp_systemapi the debugf(..) id defined.
In sming_nonos it is defined as m_printf(...) and works OK.

For now, in sming_rtos it is defined as printf(...) -> the standard printf
This is not a good solution as it interferes with debug statement in classes derived from the Print class in sming, which also has a class function printf.
Also the Serial.systemDebugOutput(true); // Debug output to serial will need to be revised (if possible).

When using the m_printf(..), compiling the framework is OK, compiling the examples but..
When linking, a number of undefined reference tom_printf'` occur.
Not for all debugf statements, sometimes even for a Serial.printf.

I checked numerous possibilities but cannot find reason or solution.

Anyone of you having an idea or direction to look for ?

Suggestion: seperating library into submodule

Currently it seems that sming and the libraries are very closely tied together.

I`d suggest seperating the library (libraries) folder from Sming and hosting either them in a seperate github repository.

We could use git submodules to link the libraries with the sming project.

it has the advantages of being able to update each seperately - new libraries or bugfixes in libraries are not dependant on the Sming repository / or a Sming release

Any thoughts on this?

basic_rboot compile issue

@raburton :
I needed to add (SMING_HOME)/system as extra include to makefile-rboot to compile on my system.

Did you compile before without issues ?
Should we get rboot-api.c out of the application make and into libsming ?

PS : I tried to make a PR instead of direct merge. Still learning on the git(hub)

RTOS threads, where are ?

I have not used yet RTOS version but ...
Is it possible to move applications without changes to the version of the RTOS?
ROTS has many advantages, but it also has drawbacks.
eg. Neopixel work which is very dependent on the time (in "Arduino").
By me transmission can be interrupted by other threads (threads is the main advantage RTOS).
How was this resolved?
I do not see any example showing the effect of RTOS, simply acts as a non rtos.
Something skipped briefly reviewing?

ESP32 RTOS vs ESP32 IDF

Based on preliminary information, it looks like Espressif will focus its development on the (IDF) more than the RTOS-SDK. According to the company:

FYI, esp-idf stands for Espressif IoT Development Framework. We've decided not to use the SDK term anymore because esp-idf is different enough from the old esp32-rtos-sdk to warrant a new name.

So this begs the question: Will SmingRTOS continue to be based on RTOS-SDK or do we need to plan for a transition to the IDF? Perhaps once it has matured a bit?
Or should we expect a SmingIDF project instead?

Undefined reference pinMode

@raburton :
I am working on a library to enable an Arduino/Attiny as a port expander.
The testversion of this is in the updated Basic_Blink application.

The library doesn't work correctly with the current implementation of Wire (I2C) within Sming.
The ArduinoESP version has more functionality so I included that one in the services directory.
The tests are successful, both new lib as old i2c (the ones I tested) work OK.
Status is that there still are some hardcoded values -> need some work.

The strange thing is however :

  • There is a file core_esp8266_si2c.c which uses the pinMode() functions.
  • As the pinMode is in the Digital.h/cpp I could not include that complete in the file
  • So I added the prototype of pinMode() to the file.
  • This compiles OK for the framework
  • The basic_blink gets a link error -> undefined reference for pinMode()

I can/did solve this by changing the extension of core_esp8266_si2c.c to cpp.
Then both framework and application compile & link OK.

I do have a working solution but like to understand the reasoning behind it.

Do you have an explanation for this ?

rboot & rboot-api into sming instead of application

Richard,
Not because of the basic_rboot trouble that we had/have but..

I think it is better to move the compiling of both rboot and rboot/appcode from application to smingframework.

Both have the same characteristics as the framework : no need to update on a per-application base.
Framework build would then generate :

  • libsming which includes rboot/appcode

  • rboot.bin

    By doing this we would :

  • Get a clear distinction between application and framework

  • Limit the risk that application compile fails due to "framework compiles"

  • We can combine makefile-project and makefile-rboot and remove the redundancy in that

Replace SMING_HOME by SMINGRTOS_HOME to avoid messing up with SMING_NONOS

Hi,

in order to prevent mixing up the code of Sming_NONOS and Sming_RTOS maybe it would be a god idea to avoid similar environment variables names in both SMING_NONOS and SMING_RTOS.

In order to test hreintkes new code for ftp server which is only in SMING_RTOS i just did this.
But to be honest, I am not sure if this is enough to avoid a mix up. Of course I also generated a new eclipse workspace and checked, that ESP_HOME need not to be modified because SDK_BASE is built by SDK_BASE ?= $(ESP_HOME)/ESP8266_RTOS_SDK.
The examples work....but not ftp server.

So may be this would be an idea for future commits, if more people would agree.

Thanks in advance

Libraries in sming should have a way to disable debug messages when not needed

Currently there are many libraries in the sming code, which print out debug messages all the time.
(for example but not limited to, the DS1820 lib).

These messages are constantly being printed to serial and interfere with the developers (using the lib) own debug process.

We shold agree o a way to disable lib debugging:
Maybe use: #define DB1820_DEBUG 0

suggestions?

Basic_WebSkeletonApp example crash when sending the AP settings

mode : softAP(5e:cf:7f:06:02:a8)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
add 1
aid 1
station: 00:25:d3:e0:87:68 join, AID = 1
{
"StaSSID": "STL",
"StaPassword": "realpass",
"StaEnable": 1
}mode : sta(5c:cf:7f:06:02:a8) + softAP(5e:cf:7f:06:02:a8)
add if0
station: 00:25:d3:e0:87:68 leave, AID = 1
rm 1
bcn 0
del if1
mode : sta(5c:cf:7f:06:02:a8)
f r0, "tiT"(stack_size = 116,task handle = 3fff1990) overflow the heap_size.
Fatal exception (20):
epc1=0x000080b8
epc2=0x00000000
epc3=0x4020b916
epcvaddr=0x000080b8
depc=0x00000000
rtn_add=0x000080b8
ú
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 28012, room 16
tail 12
chksum 0x7d
ho 0 tail 12 room 4
load 0x3ffe8000, len 944, room 12
tail 4
chksum 0x29
load 0x3ffe83b0, len 7924, room 4
tail 0
chksum 0x4a
csum 0x4a
~r[12]ì[12]�b[00]ŒžâŒb[0C]lŒbŽb[0C]bp’llìŽ|€lbìònî€[12]nnâ[10][02][0C][02]llàŒ[02][0C]l[0C]Œ[0C]lŒŽlìŽ[1E]ŒlŽ[1E]‚ìŽ[0E]ldon't use rtc mem data
€[02]nü[00]ŒžâŒb[0C]쎎[1C]p[0C][0C][02][02]ŒžâŒb[0C]l[0C]ŒbŽ[0E]lrln[0C]’€[02]ìònnnâ[0E]‚[12]nnn[0E]l�[12]nî[12]ònò�[02]lž‚[12]‚[12]nnœ[1E][00]ìŽ[0C]lb[0C]ŒŽr’ìlŽ[0E]lŽ’bâ’b[02][0C]žìr’ònò�[02]lž‚[12]‚[12]nnœ[1E][00][0C]Ž[0C]lb[0C]l[0C]l[02][12]b‚ò[12]b’r’œ|b[12]‚nlžàŒ‚[02][0C][0C]bì’b[12]nàp[12]’žâ’’[02]ìb’[12]‚[12]nnnìnr[00]l[02][12]b‚ò[12]b’r’œ|b[12]‚nlžàŒ‚[02][0C][0C]bì’b[12]nàp‚’rrnìb’[12]‚[12]nnnìnr[00]l[02]Ž’nì|ò[02]Œ[12]’ll[00][0C][12]|~ònœìnœìònnp[12]‚ͱ••Á�disable
mode : softAP(5e:cf:7f:06:02:a8)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
add 1
aid 1
station: 00:25:d3:e0:87:68 join, AID = 1
{
"StaSSID": "STL",
"StaPassword": "realpass",
"StaEnable": 1
}mode : sta(5c:cf:7f:06:02:a8) + softAP(5e:cf:7f:06:02:a8)
add if0
station: 00:25:d3:e0:87:68 leave, AID = 1
rm 1
bcn 0
del if1
mode : sta(5c:cf:7f:06:02:a8)
f r0, "tiT"(stack_size = 116,task handle = 3fff1990) overflow the heap_size.
Fatal exception (20):
epc1=0x000080b8
epc2=0x00000000
epc3=0x4020b908
epcvaddr=0x000080b8
depc=0x00000000
rtn_add=0x000080b8
ú
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

Linker error: dangerous relocation: call0: call target out of range: Cache_Read_Enable_New

My code compiles and links with the standard version of Sming, but when I try it with the RTOS version I get the following:

eric@eric-big:~/Sumpit$ make
OC out/build/libmain2.a
make -C /opt/SmingRTOS/sming/rboot
make[1]: Entering directory /opt/SmingRTOS/sming/rboot' CC rboot-stage2a.c LD /home/eric/Sumpit/out/build/rboot-stage2a.elf E2 /home/eric/Sumpit/out/build/rboot-hex2a.h CC rboot.c LD /home/eric/Sumpit/out/build/rboot.elf E2 /home/eric/Sumpit/out/firmware/rboot.bin make[1]: Leaving directory/opt/SmingRTOS/sming/rboot'
C+ app/analog_circuit.cpp
C+ app/application.cpp
C+ app/firmware_manager.cpp
C+ app/http_manager.cpp
C+ app/ibm_iot_manager.cpp
C+ app/logged_object.cpp
C+ app/ntp_manager.cpp
C+ app/sys_state.cpp
C+ app/wifi_manager.cpp
CC /opt/SmingRTOS/sming/rboot/appcode/rboot-api.c
CC /opt/SmingRTOS/sming/rboot/appcode/rboot-bigflash.c
AR out/build/app_app.a
LD out/build/app_0.out
out/build/libmain2.a(app_main.o): In function user_fatal_exception_handler': (.text+0x1a8): dangerous relocation: call0: call target out of range: Cache_Read_Enable_New out/build/libmain2.a(app_main.o): In functionuser_start':
(.text+0x3bb): dangerous relocation: call0: call target out of range: Cache_Read_Enable_New
collect2: error: ld returned 1 exit status
make: *** [out/build/app_0.out] Error 1

I'm using rboot, and my code is large enough so that I had to modify my rom0.ld file as follows:

MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40202010, len = 0x7C000
}

Any ideas? Google search provided a linker flag -mlongcalls which is already present in the rboot makefile.

Error compiling Sming_RTOS

Windows:
It was working, but doesn't coompile with latest code.

In file included from rboot/appcode/rboot-api.c:18:0:
rboot/appcode/rboot-api.c: In function 'rboot_set_config':
system/mem.h:17:27: error: implicit declaration of function 'pvPortMalloc' [-Werror=implicit-function-declaration]
#define os_malloc(s) pvPortMalloc(s, "", 0)
^
rboot/appcode/rboot-api.c:168:19: note: in expansion of macro 'os_malloc'
buffer = (uint8_)os_malloc(SECTOR_SIZE);
^
system/mem.h:16:27: error: implicit declaration of function 'vPortFree' [-Werror=implicit-function-declaration]
#define os_free(s) vPortFree(s, "", 0)
^
rboot/appcode/rboot-api.c:187:2: note: in expansion of macro 'os_free'
os_free(buffer);
^
cc1.exe: all warnings being treated as errors
make: *_* [build/rboot/appcode/rboot-api.o] Error 1

Should JsonObjectStream expose a reference to JsonBuffer?

To create an array of array the method JsonBuffer::createArray() is required:

DynamicJsonBuffer buffer;
JsonArray& list = buffer.createArray();
JsonArray& item = buffer.createArray();
item.add(1);
list.add( item );

However, the class JsonObjectStream does not a reference to the underlying JsonBuffer. If this is desired, I will provide a patch.

Include file restructuring

I made a copy of most of the include files used within sming_RTOS.

Left out the Services as they come from other upstream.
Did not (yet?) decapitalize all filemames, but think is better to do.

Benefit :
Clear include file structure which give the possibility to know/control the search path
All includes in one directory, improves on the possibility to release a "binary package" with just include files and sming framework

Please comment.
If we agree I will take the action to do this change in RTOS_Sming and adapt the includes in the source files.

I had to change the extension to txt to be able to attach -> change back to zip for usage
sming_includes.txt

c_types

Richard,
I am porting the other examples.
When compiling I get a lot of undefined types like uint32.
I have seen your remark on gitter regarding c_types_compatible.h
Been struggling already in the initial porting to get out of these.

Before getting another "temporary working solution" :
What is your opinion on how/where to include these types ?

SPI: transfer functions ignore byte order

The functions SPIClass:tranfer32 and SPIClass::transfer both initialize regvalue to mySettings._user_regvalue which is SPU_USER(SPI_NO). My assumption is that this value has to be initialized to READ_PERI_REG(SPI_USER(SPI_NO));

Instead, I'm wondering if it's necessary to read this value at all. Instead this value could be read on each transfer/transfer32 call.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.