{"action":"created","issue":{"url":"https://api.github.com/repos/anakod/Sming/issues/253","labels_url":"https://api.github.com/repos/anakod/Sming/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/anakod/Sming/issues/253/comments","events_url":"https://api.github.com/repos/anakod/Sming/issues/253/events","html_url":"https://github.com/anakod/Sming/pull/253","id":104934564,"number":253,"title":"rBoot integration and sample","user":{"login":"raburton","id":433543,"avatar_url":"https://avatars.githubusercontent.com/u/433543?v=3","gravatar_id":"","url":"https://api.github.com/users/raburton","html_url":"https://github.com/raburton","followers_url":"https://api.github.com/users/raburton/followers","following_url":"https://api.github.com/users/raburton/following{/other_user}","gists_url":"https://api.github.com/users/raburton/gists{/gist_id}","starred_url":"https://api.github.com/users/raburton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raburton/subscriptions","organizations_url":"https://api.github.com/users/raburton/orgs","repos_url":"https://api.github.com/users/raburton/repos","events_url":"https://api.github.com/users/raburton/events{/privacy}","received_events_url":"https://api.github.com/users/raburton/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-09-04T17:32:29Z","updated_at":"2015-09-08T18:08:16Z","closed_at":"2015-09-04T20:01:53Z","pull_request":{"url":"https://api.github.com/repos/anakod/Sming/pulls/253","html_url":"https://github.com/anakod/Sming/pull/253","diff_url":"https://github.com/anakod/Sming/pull/253.diff","patch_url":"https://github.com/anakod/Sming/pull/253.patch"},"body":"Allows building of rBoot itself in-tree. Sample app demonstrates big flash\r\nsupport, OTA updates and spiffs support. Intended for ESP-12 or similar\r\ndevice with 4mb of flash (but can be run on anything) where it will give\r\ntwo 1mb rom slots each with their own 1mb spiffs slot, all updatable with\r\nHTTP OTA.\r\n\r\nRecreated in new feature branch as requested, original PR #250.\r\n\r\nI really don't know if you'll be interested in this, but this integration and demo project has been several days work with help from members of esp8266.com forum, and was undertaken at their request. I thought it was worth submitting a pull request so you could take a look and see what you think. There are people out there who want to combine the two, but you may not actually want it in Sming, or maybe you'll love it, who knows!\r\n\r\nIf you aren't familiar with rBoot have a look at [my blog](http://richard.burtons.org/2015/05/18/rboot-a-new-boot-loader-for-esp8266/) from when it was first released. And [this thread](http://www.esp8266.com/viewtopic.php?f=35&t=4288) contains a lot of info about this recent work, probably starting about half way through the thread. This [blog post](http://richard.burtons.org/2015/08/31/rboot-now-supports-sming-for-esp8266/) gives some info on the earlier version of the integration.\r\n\r\n## Documentation\r\nrBoot Sming sample\r\n------------------\r\n\r\nThis sample integrates rBoot and Sming, for the many people who have been asking\r\nfor it. It demonstrates dual rom booting, big flash support, OTA updates and\r\ndual spiffs filesystems. You must enable big flash support in rBoot and use on\r\nan ESP12 (or similar device with 4mb flash). When using rBoot big flash support\r\nwith multiple 1mb slots only one rom image needs to be created. If you don't\r\nwant to use big flash support (e.g. for a device with smaller flash) see the\r\nseparate instructions below. You can easily take the ota files and add them to\r\nyour own project to add OTA support.\r\n\r\nTo build any project (in threory) with rBoot support edit the Makefile to\r\ninclude Makefile-rboot.mk instead of Makefile-project.mk. Then add variables\r\nto Makefile-user.mk as in this sample.\r\n\r\nBuilding\r\n--------\r\n 1) Set ESP_HOME & SMING_HOME, as environment variables or edit the Makefile, as\r\n    you would for general Sming compiling.\r\n 2) Set ESPTOOL2 (env var or in the Makefile) to point to the esptool2 binary.\r\n 3) Set WIFI_SSID & WIFI_PWD environment variable with your wifi details.\r\n 4) Edit the OTA server details in include/user_config.h\r\n 5) Check overridable variables in Makefile-user.mk, or set as env vars.\r\n 6) make && make flash\r\n 7) Put rom0.bin and spiff_rom.bin in the root of your webserver for OTA.\r\n 8) Interact with the sample using a terminal, sorry no web-gui (yet).\r\n\r\nFlashing\r\n--------\r\nIf flashing manually use esptool.py to flash rBoot, rom & spiffs e.g.:\r\n esptool.py --port <port> write_flash -fs 32m 0x00000 rboot.bin 0x02000 rom0.bin\r\n   0x100000 spiffs.rom\r\n\r\nUsing the correct -fs parameter is important. This will be -fs 32m on an ESP12.\r\n\r\nYou can also flash rom0.bin to 0x202000, but booting and using OTA is quicker!\r\n\r\nNotes\r\n-----\r\nspiffs_mount_manual(address, length) must be called from init. The address must\r\nbe 0x40200000 + physical flash address. It does not use memory mapped flash so\r\nthe reason for this strange addressing is not clear.\r\n\r\nImportant compiler flags used:\r\nBOOT_BIG_FLASH - when using big flash mode, ensures flash mapping code is built\r\n  in to the rom.\r\nDISABLE_SPIFFS_AUTO - prevents automounting at the wrong location. (by code in\r\n  Sming/appinit/user_main.cpp). Instead we call spiffs_mount_manual from init.\r\nRBOOT_BUILD_SMING - ensures big flash support function is correcly marked to\r\n  remain in iram (plus potentially other sming specific code in future).\r\nSPIFF_SIZE=value - passed through to code for mounting the filesystem. Also used\r\n  in the Makefile to create the spiffs.\r\n\r\nDisabling big flash\r\n-------------------\r\nIf you want to use, for example, two 512k roms in the first 1mb block of flash\r\n(old style) then follow these instructions to produce two separately linked\r\nroms. If you are flashing a single rom to multiple 1mb flash blocks (using big\r\nflash) you only need one linked rom that can be used on each.\r\n\r\nThis assumes you understand the concepts explained in the rBoot readme about\r\nmemory mapping and setting linker script address. This is not covered here, just\r\nhow to use this sample without bigflash support.\r\n\r\n- Do not copy/link rboot-bigflash.c in to your app directory.\r\n- Copy rom0.ld to rom1.ld.\r\n- Adjust the rom offsets and length as appropriate in each ld file.\r\n- Uncomment 'RBOOT_TWO_ROMS ?= 1' in Makefile-user.mk (or set as an environment\r\n  variable).\r\n- After building copy all the rom*.bin files to the root of your web server.\r\n\r\nIf you want more than two roms you must be an advanced user and should be able\r\nto work out what to copy and edit to acheive this!\r\n\r\nCredits\r\n-------\r\nThis sample was made possible with the assistance of piperpilot, gschmott and\r\nrobotiko on the esp8266.com forum."},"comment":{"url":"https://api.github.com/repos/anakod/Sming/issues/comments/138653042","html_url":"https://github.com/anakod/Sming/pull/253#issuecomment-138653042","issue_url":"https://api.github.com/repos/anakod/Sming/issues/253","id":138653042,"user":{"login":"raburton","id":433543,"avatar_url":"https://avatars.githubusercontent.com/u/433543?v=3","gravatar_id":"","url":"https://api.github.com/users/raburton","html_url":"https://github.com/raburton","followers_url":"https://api.github.com/users/raburton/followers","following_url":"https://api.github.com/users/raburton/following{/other_user}","gists_url":"https://api.github.com/users/raburton/gists{/gist_id}","starred_url":"https://api.github.com/users/raburton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raburton/subscriptions","organizations_url":"https://api.github.com/users/raburton/orgs","repos_url":"https://api.github.com/users/raburton/repos","events_url":"https://api.github.com/users/raburton/events{/privacy}","received_events_url":"https://api.github.com/users/raburton/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T18:08:16Z","updated_at":"2015-09-08T18:08:16Z","body":"I've updated the PR from my feature branch to the sming feature branch with the windows linker fix and a small improvement to the sample."}}