-
-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial esp-idf 3.0 build #1388
Conversation
libs/network/network.c
Outdated
@@ -672,7 +672,8 @@ int netCreateSocket(JsNetwork *net, SocketType socketType, uint32_t host, unsign | |||
if (sckt<0) return sckt; | |||
|
|||
#ifdef USE_TLS | |||
assert(sckt>=0 && sckt<32); | |||
// NEED TO FIX - as socket is assumed to be < 32 | |||
//assert(sckt>=0 && sckt<32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gfwilliams
FYI @jumjum123
The move to esp-idf has changed the number range of the file descriptions. They are not longer < 32 and I believe the assert was due to the sckt number being used in flags.
Can you think of a good way to work around this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just removed those lines. I believe they were there for TLS when we used a bitfield to store whether the socket was using TLS or not. Since @opichals work on UDP the bitfields were no longer needed \o/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Hi @jumjum123
and when I change to I then get:
|
@wilberforce #!/bin/bash |
Ahhh thanks.. it needs the flag. I compile like this:
and when tracking down errors:
So you don't get the parallel make. For me - the environment is set up with It compiles - then fails on link:
Does this look familiar? |
@jumjum123 I've not solved the BLE security module issue yet, - I don't think I have it compiled in the libs. Do we need this compiled in? The difference is here:
|
My development path is based on our old mate. BTW, would like to know, how Neil feels, reading this ;-)
Just read your latest message, yes SMP needs to be enabled |
Turning the flag on I got a build: -rw-rw-rw- 1 wilberforce wilberforce 843168 May 7 18:32 espruino_1v97.8_esp32.bin First is without BLE, the 2nd with! With this size - I'm not sure if we'll need to move the js_code partition anymore? |
tried to boot with old partition table:
I'll see if I can get it to fit! |
my latest partition table was this, as you can see, only minor changes to have memory for firmware BTW, IIRC, heap in BLE version is smaller. Or with other words, heap without BLE should give the option to increase jsVars. espruinoTask in main.c already supports this for later versions with PSRAM pin 16 and 17 are reserved for PSRAM, which we don't support yet. Please see jshPinDefaultPullup() in jshardware.c #Name, Type, SubType, Offset, Size, Flags |
I'm thinking of making the js_code partition bigger than 64K. Say at least 128K. Then there is plenty of space for modules. Since the firmware overlaps into 0x100000 - the next boundry is 0x200000. We leave 0x200000-0x300000 free an have the js_code start at say 0x200000 - js_code_size. [ 0x10000 firmware 1400K?] |
Here is the partition table - it has room for large firmware x2 ( incase we do want to do ota at some stage) and 256K for js_code!
|
Issues with current build - save() not working - need to updated saved code area 0x2C0000 |
…rase flash before flashing
…rase flash before flashing
…rase flash before flashing
…rase flash before flashing
@gfwilliams - Ready to merge with master please. @jumjum123 I have pulled all the changes from the esp32 branch - except relating to the psram. After this is merged, we can look at pulling the changes above into the ESP32 branch, as there have been changes to master that are not in the esp32 branch. JSVARs are down to 2500 from 5000 ;-(. We probably need a way to look at turning the BLE off/on and getting for jsvars avaiable when off. |
scripts/common.py
Outdated
if ("ifdef" in jsondata) and not (jsondata["ifdef"] in defines): | ||
print(dropped_prefix+" because of #ifdef "+jsondata["ifdef"]) | ||
drop = True | ||
if ("ifdef" in jsondata): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could we ditch this change? I assume it's because of the use of "ifdef" : "NRF52,ESP32"
, but everywhere else in Espruino we just use "#if" : "defined(NRF52) || defined(ESP32)"
when we want to do something like this, so we should do that here (especially as it's not mirrored for ifndef, and the documentation won't be created correctly for it either).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I will get to this tonight - it's 8pm here. I'll try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got your OK some time ago, to do it this way ;-)
I didn't know better, therefor I added my way.
At least the documentation is a big point.
@wilberforce, where should I do these changes. I would recommend to use ESP32-v3.0 branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please - ESP32-v3.0 branch. I have spent many hours merging carefully so nothing breaks ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry about the confusion @jumjum123 - I guess I wasn't paying attention at the time :(
libs/bluetooth/jswrap_bluetooth.h
Outdated
@@ -33,6 +33,7 @@ typedef enum { | |||
#define BLETASK_IS_CENTRAL(x) ((x)>=BLETASK_CENTRAL_START && ((x)<=BLETASK_CENTRAL_END)) | |||
|
|||
extern JsVar *bleTaskInfo; // info related to the current task | |||
extern JsVar *blePromise; //defined here, used in jswrap_bluetooth.c and in ESP32 relevant bluetooth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? I'm not sure it is used and it'd be good to keep it private - ble*Task
functions should hopefully provide everything that's needed to deal with the promises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too familar with the code here @jumjum123 did this.... Do you mean put in in a #ifdef ESP32 ? Or ditch it all together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have in mind, I had to do this for some reason.
But don't remember why :-(
Something like "ran into error during compiling"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jumjum123
Looks like this can be removed as it's not getting used at this point.
Looks great! is it possible to tweak the above two things? Otherwise I can do it when merging - it won't take long. |
First of all big THANKS to @wilberforce and @gfwilliams
@gfwilliams if you could do the changes, would be a big help. You are much faster than I could ever be. @wilberforce, as soons as I get UART running, my next step will be to check how we can switch off BLE during runtime. I've some ideas for testing. Hopefully, we will get some memory back for jsVars |
Yeah, that could just be Sure, I'll tweak and merge (since I merged some other PRs there's a minor conflict I need to tweak anyway). Probably won't be until much later today though as I've got a bunch of Pixl boards to pack and send out. |
I've cleaned up the promise var, and the conditional builds - and tried to revert common.py I'm getting a link error now - possibly broke the wrapper code????
Let's see what the travis build comes back with. I've broken something. Bugger. I'm out of time, so will sort tomorrow unless you get to it first. |
and I have added to the change log incorrectly ;-() put the thing at the top rather than the bottom:
|
@gfwilliams - looks like all good now - just the Changelog to sort! |
Awesome - thanks for doing that! |
All merged - thanks for all your work on this everyone! @jumjum123 I will get a global |
Not yet ready to merge!