--
You received this message because you are subscribed to the Google Groups "esp-open-rtos mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to esp-open-rto...@googlegroups.com.
To post to this group, send email to esp-op...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/esp-open-rtos/20160224041032.GJ26205%40ex2.lan.
For more options, visit https://groups.google.com/d/optout.
I've been thinking for a little while about maybe creating a custom terminal program (possibly hooking into esptool.py so that you could reflash an image without having to exit the terminal, etc) which could not only handle the nonstandard baud rate, but could actually detect a transition indicator sent by esp-open-rtos (or rboot) indicating a bps change and automagically change along with it.. Of course I haven't really investigated how much of the initial output comes from the ROM vs the bootloader.. if there isn't a lot from the ROM and we can set the baud rate consistently and early, it might not be as big a deal..
I think we should have a standard way to configure various parameters/settings/etc for a given ESP8266 without having to compile them into the firmware image and reflash the whole thing (these could be configured with something similar to esptool.py, and could persist across reflashing, etc). The most obvious use cases for this would be WiFi SSID and password settings, server hostnames, etc, but another potential use would be for people to choose what baud rate they would prefer esp-open-rtos to start up with.. That way you could have your 115200, and I can use 74880 (or whatever) even when using exactly the same flash code (or even the same prebuilt image).
Heh, I guess great minds think alike :). I've about half-written something a bit more sophisticated but basically along exactly the same lines as your "past" code for my own "system parameter" proof-of-concept.. I'll see if I can finish it up in the next few days so I can put it up for discussion as well (in a different thread :) )
To view this discussion on the web visit https://groups.google.com/d/msgid/esp-open-rtos/41771c06-356f-4e4c-a5ef-4d83738c52c5%40googlegroups.com.
Although I still favour working around Espressif-introduced "weirdness" wherever we can, and 74880bps definitely falls under the "weirdness" category for me.
... the 'rst cause'/'boot mode' can be extracted by the bootloader and re-printed at a different baud rate.
On a related note, something I'd like to try (someday) is default runtime auto-detection of flash size and type, instead of having to flash it into the device. Obviously won't work in all cases (would need a manual override), but it'd be nice (and possible, I think) to have defaults that work optimally nearly everywhere.
Neat idea, I guess this would require a file format aware flashing tool.
On a related note, something I'd like to try (someday) is default runtime auto-detection of flash size and type, instead of having to flash it into the device. Obviously won't work in all cases (would need a manual override), but it'd be nice (and possible, I think) to have defaults that work optimally nearly everywhere.Heh.. funny you should mention that.. that's actually sorta the next thing on my "want to do" list.. The SPI flash protocols actually have a fairly standard way to get this info from the chip already, we just need to write the code to do the query and use the results (and completely ignore the value in the flash header).
Neat idea, I guess this would require a file format aware flashing tool.Yeah, I was kinda figuring this would all involve some modified/new tools..
>> Heh.. funny you should mention that.. that's actually sorta the next thing on my "want to do" list.. The SPI flash protocols actually have a fairly standard way to get this info from the chip already, we just need to write the code to do the query and use the results (and completely ignore the value in the flash header).
>
>
> This one is a must have if you ask me. I recall an SDK function to get the flash JEDEC ID and then all we need to do is make a lookup table to map flash ID with its size. Depending on what the user told the flashing tool seems like something that was used to get things up and running quickly and then, as these things go, became the permanent solution ;)
No, this is exactly what we should not do. I realize that's what everybody else has been doing but it's still error-prone and wrong. What I was actually trying to point out is that there is a fairly standard command for SPI flash devices (completely separate from the "get id" command) that actually tells you the size and layout of the chip you're talking to, without having to do any hacky JEDEC ID lookups, etc. I don't know why Espressif didn't use it in the first place, but we should. That's the correct way to do this sort of thing.
** Proposed Solution **
We already use the open source bootloader, rboot, when building images in "OTA" mode. This is similar to the bootloader approach Espressif use on their recent SDKs. The rom bootloader loads the rboot stub into IRAM and executes it, then rboot loads all the other image components and executes those. If the build process was changed to remove the non-OTA mode, we could write a forked rboot that sets the baud rate to 115200 first up before it loads the main image.
- A standalone bootloader would let us code in additional diagnostic output, and/or pass a flag to the main image telling it to enable or disable diagnostic/verbose output when it starts up.
1) ROM bootloader initially sets internal "APB" PLL to XTAL*2, sets UART divider to 694. This means nominal 115200bps for 40MHz crystals, 74880 for 26MHz crystals. I'm betting this means the initial CPU speed is also 52MHz on 26MHz crystals.
3) Startup function init_networking() calls register_chipv6_phy(phy_info) which reconfigures the PLL based on the crystal value stored in the "wifi/phy config" sector in the flash (which is where phy_info is read from). It sets them for an 80MHz APB & CPU frequency.