forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
Spresense #3
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This also fixes deleting the PPP task, since eTaskGetState() never returns eDeleted. A limitation with this patch: once the PPP is deactivated (ppp.active(0)) it cannot be used again. A new PPP instance must be created instead.
Recent gcc versions (at least 9.1) give a warning about using "sp" in the clobber list. Such code is removed by this patch. A dedicated function is instead used to set SP and branch to the bootloader so the code has full control over what happens. Fixes issue micropython#4785.
For modules I initially created or made substantial contributions to.
This allows to efficiently send to an I2C slave data that is made up of more than one buffer. Instead of needing to allocate temporary memory to combine buffers together this new method allows to pass in a tuple or list of buffers. The name is based on the POSIX function writev() which has similar intentions and signature. The reasons for taking this approach (compared to having an interface with separate start/write/stop methods) are: - It's a backwards compatible extension. - It's convenient for the user. - It's efficient because there is only one Python call, then the C code can do everything in one go. - It's efficient on the I2C bus because the implementation can do everything in one go without pauses between blocks of bytes. - It should be possible to implement this extension in all ports, for hardware and software I2C. Further discussion is found in issue micropython#3482, PR micropython#4020 and PR micropython#4763.
API is: int transfer( mp_obj_base_t *obj, uint16_t addr, size_t n, mp_machine_i2c_buf_t *bufs, unsigned int flags )
For example: i2c.writevto(addr, (buf1, buf2)). This allows to efficiently (wrt memory) write data composed of separate buffers, such as a command followed by a large amount of data.
On stm32 boards, machine.I2C is now preferred over pyb.I2C.
Previously the hardware I2C timeout was hard coded to 50ms which isn't guaranteed to be enough depending on the clock stretching specs of the I2C device(s) in use. This patch ensures the hardware I2C implementation honors the existing timeout argument passed to the machine.I2C constructor. The default timeout for software and hardware I2C is now 50ms.
On MCUs that have an I2C TIMINGR register, this can now be explicitly set via the "timingr" keyword argument to the I2C constructor, for both machine.I2C and pyb.I2C. This allows to configure precise timing values when the defaults are inadequate.
Reuse the implementation for bytes since it works the same way regardless of the underlying type. This method gets added for CPython compatibility of bytearray, but to keep the code simple and small array.array now also has a working decode method, which is non-standard but doesn't hurt.
The variable $(CAT) is initialised with the "cat" value in mkenv.mk like for the other command line tools (rm, echo, cp, mkdir etc). With this, for example, Windows users can specify the path of cat.exe.
Updating the nrfx git submodule containing HAL drivers for nrf-port from v1.3.1 to current master. The version pointed to is one commit ahead of v1.7.1 release. The extra commit contains a bugfix for nrfx_uart_tx_in_progress() making it report correctly. The general upgrade of nrfx is considered to be safe, as almost all changes in between 1.3.1 and 1.7.1 are related to peripherals and target devices not used by the nrf-port as of today.
Defining NRFX_STATIC_ASSERT macro to be empty, but available to nrfx.
As part of this, ctrl-C is now able to interrupt a running program.
The variable $(TOUCH) is initialized with the "touch" value in mkenv.mk like for the other command line tools (rm, echo, cp, mkdir etc). With this, for example, Windows users can specify the path of touch.exe.
This enables going back to previous wrapped lines using backspace or left arrow: instead of just sticking to the beginning of a line, the cursor will move a line up.
Configurable via MICROPY_PY_LWIP_SOCK_RAW.
Some SD/MMC breakout boards don't support 4-bit bus mode. This adds a new macro MICROPY_HW_SDMMC_BUS_WIDTH that allows each board to define the width of the SD/MMC bus interface used on that board, defaulting to 4 bits.
Basic support for Spresense board. Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
Add access to NuttX file system with SD card and Flash memory. Signed-off-by: Kamil Tomaszewski <kamil.tomaszewski@sony.com>
kamtom480
pushed a commit
that referenced
this pull request
Jun 1, 2020
add standard SPI support to QSPI for external flash
kamtom480
pushed a commit
that referenced
this pull request
Nov 19, 2020
Small improvements to the dictionary compression
kamtom480
pushed a commit
that referenced
this pull request
Nov 19, 2020
It was incorrect to NULL out the pointer to our heap allocated buffer in `reset`, because subsequent to framebuffer_reset, but while the heap was still active, we could call `get_bufinfo` again, leading to a fresh allocation on the heap that is about to be destroyed. Typical stack trace: ``` #1 0x0006c368 in sharpdisplay_framebuffer_get_bufinfo #2 0x0006ad6e in _refresh_display #3 0x0006b168 in framebufferio_framebufferdisplay_background micropython#4 0x00069d22 in displayio_background micropython#5 0x00045496 in supervisor_background_tasks micropython#6 0x000446e8 in background_callback_run_all micropython#7 0x00045546 in supervisor_run_background_tasks_if_tick micropython#8 0x0005b042 in common_hal_neopixel_write micropython#9 0x00044c4c in clear_temp_status micropython#10 0x000497de in spi_flash_flush_keep_cache micropython#11 0x00049a66 in supervisor_external_flash_flush micropython#12 0x00044b22 in supervisor_flash_flush micropython#13 0x0004490e in filesystem_flush micropython#14 0x00043e18 in cleanup_after_vm micropython#15 0x0004414c in run_repl micropython#16 0x000441ce in main ``` When this happened -- which was inconsistent -- the display would keep some heap allocation across reset which is exactly what we need to avoid. NULLing the pointer in reconstruct follows what RGBMatrix does, and that code is a bit more battle-tested anyway. If I had a motivation for structuring the SharpMemory code differently, I can no longer recall it. Testing performed: Ran my complicated calculator program over multiple iterations without observing signs of heap corruption. Closes: micropython#3473
kamtom480
pushed a commit
that referenced
this pull request
Jan 25, 2021
kamtom480
pushed a commit
that referenced
this pull request
Jul 27, 2021
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 micropython#4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni micropython#5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/ micropython#6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m micropython#7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308 micropython#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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.