-
Notifications
You must be signed in to change notification settings - Fork 78
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
Zephyr rebase #2
Conversation
The outputexpors target, which exports Zephyr environment variables, was recently added to Zephyr. By exploiting this feature we can hugely simplify the build system, improving robustness at the same time. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Allow micropython to automatically disable features that Zephyr has been configured not to support. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The boot issue text mentions a help() function and encourages the user to run it. It is very disconcerting to find that the function does not exist... Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
This provides time and sleep together with the usual ticks_us/_ms_diff and sleep_us/ms family. We also provide access to Zephyr's high precision timer as ticks_cycles (augmented by cycles_to_ns). Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The integration with Zephyr is fairly clean but requires us to use two arguments to describe a pin: drv_name - Name to be sent to device_get_binding() pin - Pin number within the port identified by drv_name There is support for in/out pins and pull up/pull down but currently there is no interrupt support. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Thanks Daniel. I didn't proceed with rebasing/merging so far, as I lost comfortable access to github for now. But as this PR cleanly applies on top of my zephyr branch, let me just merge it into it, and tomorrow I plan to squash/merge stuff. Thanks! |
Ok, cherry-picked into the master the Makefile evolution up to and including "Exploit "make outputexports"", while squashing and cleaning it up whenever possible (while squashing the main aim was preserving authorship of your patches, thought I squashed couple of your smaller changes). Can you please verify that "Exploit "make outputexports"" was merged faithfully? (There were quite a bunch of conflicting resolution cases due to cherry-picking build system changes out of complete change arrays). |
Looks OK to me. Note that the remains of the 'Exploit "make outputexports"' patch no longer really makes sense on its own. I'd suggest splitting it out into the three changes (modusocket.c, .gitignore, README.md) and squashing these into your own patches. The same goes for "zephyr: Allow NETWORKING and MBEDTLS to be disabled"; this is better squashed into the socket/mbedtls code. For the build system I agree trying to maintain authorship just makes the patchset look wierd. Rather than trying to maintain authorship, its probably better just to put a credit in the patch description of one of the squashed patches. |
Thanks for confirming that!
Will do. I plan to write a new README from scratch. And I don't plan to merge modsocket, given that it barely works, and should be rewritten against new Z IP stack (which itself needs work first).
Well, I think it's ok, and it makes sense to preserve the evolution of Zephyr build system integration, to be a live evidence why "outputexports" was needed. Ok, so I'll proceed with merging few other low-hanging things, to fit into micropython 1.8.5 release. Other things (e.g. machine.Pin) may need more discussion/work. |
Sure. Getting the basic port upstream first is the most important step. Once that's landed I can send PRs to the main project like any other developer! On October 10, 2016 4:23:08 PM GMT+01:00, Paul Sokolovsky notifications@github.com wrote:
Sent using a tiny, tiny keyboard. Pleasw excise any spelkinh nistajes. |
@daniel-thompson : I'm going to merge "Implement the help() function" to master due to reasons you mention in the commit, but help() implementation is a major source of code duplication in uPy, and it's on TODO for refactoring... P.S. It seems that your Linaro commit email isn't recognized by github as belonging to your account, which causes minor usability issues (like inability to @ mention easily), could you please consider adding it to your github account? |
Otherwise, I think master now contains pretty good basic Zephyr port, just in time for 1.8.5. So, let the release happen and then look into further things. |
Yes. When I wrote it I wondered why it didn't walk the list of built in modules to automate much of the help... PS Done. My work mail is now hooked up to github. On October 12, 2016 5:25:41 PM GMT+01:00, Paul Sokolovsky notifications@github.com wrote:
Sent using a tiny, tiny keyboard. Pleasw excise any spelkinh nistajes. |
@daniel-thompson : So, I had a look at your modutime.c, and here're comments:
Thanks. |
And here's modutime deduplication refactor I meant previously: micropython/micropython#2514 |
asan considers that memcmp(p, q, N) is permitted to access N bytes at each of p and q, even for values of p and q that have a difference earlier. Accessing additional values is frequently done in practice, reading 4 or more bytes from each input at a time for efficiency, so when completing "non_exist<TAB>" in the repl, this causes a diagnostic: ==16938==ERROR: AddressSanitizer: global-buffer-overflow on address 0x555555cd8dc8 at pc 0x7ffff726457b bp 0x7fffffffda20 sp 0x7fff READ of size 9 at 0x555555cd8dc8 thread T0 #0 0x7ffff726457a (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a) #1 0x555555b0e82a in mp_repl_autocomplete ../../py/repl.c:301 #2 0x555555c89585 in readline_process_char ../../lib/mp-readline/re #3 0x555555c8ac6e in readline ../../lib/mp-readline/readline.c:513 #4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni #5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/ #6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m #7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308 #8 0x55555595fd69 in _start (/home/jepler/src/micropython/ports/uni 0x555555cd8dc8 is located 0 bytes to the right of global variable 'import_str' defined in '../../py/repl.c:285:23' (0x555555cd8dc0) of size 8 'import_str' is ascii string 'import ' Signed-off-by: Jeff Epler <jepler@gmail.com>
Hi Paul
Rebasing on your 'connect branch turned out to be a nop so I thought I'd send in a PR anyway. If you've already started rebasing your stuff then no worries. Just ping when you're done and I can rebase again...
Daniel.