From f8e5e2da64fbf2131d77a0834de0b91b102afdee Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 31 Jan 2019 10:50:07 +1100 Subject: Start on nRF nvm.ByteArray adafruit/circuitpython#1042 (doesn't do anything yet) --- .../nrf/boards/feather_nrf52840_express/mpconfigboard.h | 2 +- ports/nrf/common-hal/microcontroller/__init__.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index eb8be7608..21232d2b3 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -55,7 +55,7 @@ #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index c2e0c5b41..f29b0eb95 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -24,9 +24,14 @@ * THE SOFTWARE. */ +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + #include "common-hal/microcontroller/Pin.h" #include "common-hal/microcontroller/Processor.h" +#include "shared-bindings/nvm/ByteArray.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" @@ -63,6 +68,17 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; +#if CIRCUITPY_INTERNAL_NVM_SIZE > 0 +// The singleton nvm.ByteArray object. +const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { + .base = { + .type = &nvm_bytearray_type, + }, + .len = CIRCUITPY_INTERNAL_NVM_SIZE, + .start_address = 0 +}; +#endif + STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_00), MP_ROM_PTR(&pin_P0_00) }, -- cgit v1.2.3 From 492431a694283345109bc29f478d13463aeb5661 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 31 Jan 2019 11:17:41 +1100 Subject: nvm.ByteArray reads & writes but no sensible erase yet adafruit/circuitpython#1042 --- .../feather_nrf52840_express/mpconfigboard.h | 1 + ports/nrf/common-hal/microcontroller/__init__.c | 2 +- ports/nrf/common-hal/nvm/ByteArray.c | 49 ++++++++++++++++++++++ ports/nrf/common-hal/nvm/ByteArray.h | 38 +++++++++++++++++ ports/nrf/common-hal/nvm/__init__.c | 27 ++++++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 ports/nrf/common-hal/nvm/ByteArray.c create mode 100644 ports/nrf/common-hal/nvm/ByteArray.h create mode 100644 ports/nrf/common-hal/nvm/__init__.c diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index 21232d2b3..d007a1812 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -32,6 +32,7 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "Feather52840Express" +#define FLASH_SIZE (0x100000) #define MICROPY_HW_NEOPIXEL (&pin_P0_16) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index f29b0eb95..7055cb236 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -75,7 +75,7 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .type = &nvm_bytearray_type, }, .len = CIRCUITPY_INTERNAL_NVM_SIZE, - .start_address = 0 + .start_address = FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE }; #endif diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c new file mode 100644 index 000000000..6298ce18e --- /dev/null +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/nvm/ByteArray.h" + +#include +#include + +#include "nrf_nvmc.h" + +uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { + return self->len; +} + +bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint8_t* values, uint32_t len) { + printf("%ld %ld\n", start_index, len); + nrf_nvmc_page_erase(self->start_address); + nrf_nvmc_write_bytes(self->start_address + start_index, values, len); + return true; +} + +void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint32_t len, uint8_t* values) { + memcpy(values, (uint8_t *)(self->start_address + start_index), len); +} diff --git a/ports/nrf/common-hal/nvm/ByteArray.h b/ports/nrf/common-hal/nvm/ByteArray.h new file mode 100644 index 000000000..e47a87b9e --- /dev/null +++ b/ports/nrf/common-hal/nvm/ByteArray.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint32_t start_address; + uint32_t len; +} nvm_bytearray_obj_t; + +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/nrf/common-hal/nvm/__init__.c b/ports/nrf/common-hal/nvm/__init__.c new file mode 100644 index 000000000..3cdc9d3a4 --- /dev/null +++ b/ports/nrf/common-hal/nvm/__init__.c @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// No nvm module functions. -- cgit v1.2.3 From 592bd0140a22b34daf44ad6d648ee0c642ab45de Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Tue, 9 Apr 2019 10:55:15 +1000 Subject: switch CIRCUITPY_NVM on! --- ports/nrf/mpconfigport.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index fdeb1bbbe..83166708a 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -19,8 +19,8 @@ CIRCUITPY_AUDIOBUSIO = 0 # No I2CSlave implementation CIRCUITPY_I2CSLAVE = 0 -# nvm not yet implemented -CIRCUITPY_NVM = 0 +# enable NVM +CIRCUITPY_NVM = 1 # enable RTC CIRCUITPY_RTC = 1 -- cgit v1.2.3 From 8e7fee22465c556f0f5e1b83c99313a3657652f9 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 31 Jan 2019 15:48:19 +1100 Subject: Working flash pages for nvm.ByteArray adafruit/circuitpython#1042 import microcontroller def dump(n = microcontroller.nvm): for i in range(0,len(n)): print ("%02X " % n[i], end="") if i % 16 == 15: print('') microcontroller.nvm[0:4096] = bytes([1,2,3,4,5,6,7,8]) * 512 microcontroller.nvm[4096:8192] = bytes([16,17,18,19]) * 1024 microcontroller.nvm[4090:4101] = b'thisisatest' microcontroller.nvm[100:105] = b'hello' microcontroller.nvm[8000:8007] = b'goodbye' dump() --- .../feather_nrf52840_express/mpconfigboard.h | 2 ++ ports/nrf/common-hal/nvm/ByteArray.c | 34 ++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index d007a1812..e1f43e3c9 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -32,7 +32,9 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "Feather52840Express" + #define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (4096) #define MICROPY_HW_NEOPIXEL (&pin_P0_16) diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index 6298ce18e..7393ce0a5 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -35,11 +35,39 @@ uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { return self->len; } +static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { + // Write a whole page to flash, buffering it first and then erasing and rewriting + // it since we can only clear a whole page at a time. + // TODO (maybe) check if only clearing bits (don't need to erase) + // XXX should this suspend interrupts so erase/write is atomic? + + if (offset == 0 && len == FLASH_PAGE_SIZE) { + nrf_nvmc_page_erase(page_addr); + nrf_nvmc_write_bytes(page_addr, bytes, FLASH_PAGE_SIZE); + } else { + uint8_t buffer[FLASH_PAGE_SIZE]; + memcpy(buffer, (uint8_t *)page_addr, FLASH_PAGE_SIZE); + memcpy(buffer + offset, bytes, len); + nrf_nvmc_page_erase(page_addr); + nrf_nvmc_write_bytes(page_addr, buffer, FLASH_PAGE_SIZE); + } +} + bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { - printf("%ld %ld\n", start_index, len); - nrf_nvmc_page_erase(self->start_address); - nrf_nvmc_write_bytes(self->start_address + start_index, values, len); + + uint32_t address = self->start_address + start_index; + uint32_t offset = address % FLASH_PAGE_SIZE; + uint32_t page_addr = address - offset; + + while (len) { + uint32_t write_len = MIN(len, FLASH_PAGE_SIZE - offset); + write_page(page_addr, offset, write_len, values); + len -= write_len; + values += write_len; + page_addr += FLASH_PAGE_SIZE; + offset = 0; + } return true; } -- cgit v1.2.3 From cd69db777034ea7bbda1ed19da742a032767e01f Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 4 Apr 2019 15:40:12 +1100 Subject: Add a peripherals/nrf/nvm.c to wrap flash page writes safely --- ports/nrf/Makefile | 1 + ports/nrf/peripherals/nrf/nvm.c | 96 +++++++++++++++++++++++++++++++++++++++++ ports/nrf/peripherals/nrf/nvm.h | 28 ++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 ports/nrf/peripherals/nrf/nvm.c create mode 100644 ports/nrf/peripherals/nrf/nvm.h diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 3cb4b52aa..b32b25217 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -177,6 +177,7 @@ SRC_C += \ peripherals/nrf/clocks.c \ peripherals/nrf/$(MCU_CHIP)/pins.c \ peripherals/nrf/$(MCU_CHIP)/power.c \ + peripherals/nrf/nvm.c \ peripherals/nrf/timers.c \ sd_mutex.c \ supervisor/shared/memory.c diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c new file mode 100644 index 000000000..f9cc1b806 --- /dev/null +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -0,0 +1,96 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//#include "py/obj.h" +#include "py/runtime.h" + +#include +#include + +#include "nrf_nvmc.h" + +#ifdef BLUETOOTH_SD +#include "ble_drv.h" +#include "nrf_sdm.h" + +#define FLASH_PAGE_SIZE (4096) + +STATIC void sd_flash_operation_start(void) { + sd_flash_operation_status = SD_FLASH_OPERATION_IN_PROGRESS; +} + +STATIC sd_flash_operation_status_t sd_flash_operation_wait_until_done(void) { + while (sd_flash_operation_status == SD_FLASH_OPERATION_IN_PROGRESS) { + sd_app_evt_wait(); + } + return sd_flash_operation_status; +} +#endif + +void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { + #ifdef BLUETOOTH_SD + uint8_t sd_en = 0; + (void) sd_softdevice_is_enabled(&sd_en); + if (sd_en) { + uint32_t err_code; + sd_flash_operation_status_t status; + + sd_flash_operation_start(); + err_code = sd_flash_page_erase(page_addr / FLASH_PAGE_SIZE); + if (err_code != NRF_SUCCESS) { + mp_raise_OSError_msg_varg(translate("Flash erase failed to start, err 0x%04x"), err_code); + } + status = sd_flash_operation_wait_until_done(); + if (status == SD_FLASH_OPERATION_ERROR) { + mp_raise_OSError_msg(translate("Flash erase failed")); + } + + // Divide a full page into parts, because writing a full page causes an assertion failure. + // See https://devzone.nordicsemi.com/f/nordic-q-a/40088/sd_flash_write-cause-nrf_fault_id_sd_assert/ + const size_t BLOCK_PARTS = 2; + size_t words_to_write = FLASH_PAGE_SIZE / sizeof(uint32_t) / BLOCK_PARTS; + for (size_t i = 0; i < BLOCK_PARTS; i++) { + sd_flash_operation_start(); + err_code = sd_flash_write(((uint32_t *)page_addr) + i * words_to_write, + (uint32_t *)data + i * words_to_write, + words_to_write); + if (err_code != NRF_SUCCESS) { + mp_raise_OSError_msg_varg(translate("Flash write failed to start, err 0x%04x"), err_code); + } + status = sd_flash_operation_wait_until_done(); + if (status == SD_FLASH_OPERATION_ERROR) { + mp_raise_OSError_msg(translate("Flash write failed")); + } + } + + return; + } + #endif + + nrf_nvmc_page_erase(page_addr); + nrf_nvmc_write_bytes(page_addr, data, FLASH_PAGE_SIZE); +} diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h new file mode 100644 index 000000000..e051bdbe5 --- /dev/null +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -0,0 +1,28 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); -- cgit v1.2.3 From bc9244180388860c831fb795d89fed2c09aa7a76 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 4 Apr 2019 15:42:33 +1100 Subject: switch nvm.ByteArray to use new nrf_nvm_safe_flash_page_write adafruit/circuitpython#1610 --- ports/nrf/common-hal/nvm/ByteArray.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index 7393ce0a5..d69abbdac 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -29,7 +29,7 @@ #include #include -#include "nrf_nvmc.h" +#include "peripherals/nrf/nvm.h" uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { return self->len; @@ -38,18 +38,14 @@ uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { // Write a whole page to flash, buffering it first and then erasing and rewriting // it since we can only clear a whole page at a time. - // TODO (maybe) check if only clearing bits (don't need to erase) - // XXX should this suspend interrupts so erase/write is atomic? if (offset == 0 && len == FLASH_PAGE_SIZE) { - nrf_nvmc_page_erase(page_addr); - nrf_nvmc_write_bytes(page_addr, bytes, FLASH_PAGE_SIZE); + nrf_nvm_safe_flash_page_write(page_addr, bytes); } else { uint8_t buffer[FLASH_PAGE_SIZE]; memcpy(buffer, (uint8_t *)page_addr, FLASH_PAGE_SIZE); memcpy(buffer + offset, bytes, len); - nrf_nvmc_page_erase(page_addr); - nrf_nvmc_write_bytes(page_addr, buffer, FLASH_PAGE_SIZE); + nrf_nvm_safe_flash_page_write(page_addr, buffer); } } -- cgit v1.2.3 From bcb87ffd6cd954e3fbdd2354cf83f9974c4d8547 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 4 Apr 2019 15:43:40 +1100 Subject: Switch supervisor/internal_flash to use new nrf_nvm_safe_flash_page_write adafruit/circuitpython#1610 --- ports/nrf/supervisor/internal_flash.c | 88 ++++------------------------------- ports/nrf/supervisor/internal_flash.h | 1 - 2 files changed, 10 insertions(+), 79 deletions(-) diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index c18b708a3..9aaaf9b5d 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" -#include "nrf_nvmc.h" +#include "peripherals/nrf/nvm.h" #ifdef BLUETOOTH_SD #include "ble_drv.h" @@ -47,9 +47,8 @@ extern uint32_t __fatfs_flash_start_addr[]; extern uint32_t __fatfs_flash_length[]; #define NO_CACHE 0xffffffff -#define FL_PAGE_SZ 4096 -uint8_t _flash_cache[FL_PAGE_SZ] __attribute__((aligned(4))); +uint8_t _flash_cache[FLASH_PAGE_SIZE] __attribute__((aligned(4))); uint32_t _flash_page_addr = NO_CACHE; @@ -71,78 +70,11 @@ uint32_t supervisor_flash_get_block_count(void) { return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; } -#ifdef BLUETOOTH_SD -STATIC void sd_flash_operation_start(void) { - sd_flash_operation_status = SD_FLASH_OPERATION_IN_PROGRESS; -} - -STATIC sd_flash_operation_status_t sd_flash_operation_wait_until_done(void) { - while (sd_flash_operation_status == SD_FLASH_OPERATION_IN_PROGRESS) { - sd_app_evt_wait(); - } - return sd_flash_operation_status; -} -#endif - -void supervisor_flash_flush(void) { - if (_flash_page_addr == NO_CACHE) return; - - // Skip if data is the same - if (memcmp(_flash_cache, (void *)_flash_page_addr, FL_PAGE_SZ) != 0) { - -#ifdef BLUETOOTH_SD - uint8_t sd_en = 0; - (void) sd_softdevice_is_enabled(&sd_en); - - if (sd_en) { - uint32_t err_code; - sd_flash_operation_status_t status; - - sd_flash_operation_start(); - err_code = sd_flash_page_erase(_flash_page_addr / FL_PAGE_SZ); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash erase failed to start, err 0x%04x"), err_code); - } - status = sd_flash_operation_wait_until_done(); - if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash erase failed")); - } - - // Divide a full page into parts, because writing a full page causes an assertion failure. - // See https://devzone.nordicsemi.com/f/nordic-q-a/40088/sd_flash_write-cause-nrf_fault_id_sd_assert/ - const size_t BLOCK_PARTS = 2; - size_t words_to_write = FL_PAGE_SZ / sizeof(uint32_t) / BLOCK_PARTS; - for (size_t i = 0; i < BLOCK_PARTS; i++) { - sd_flash_operation_start(); - err_code = sd_flash_write(((uint32_t *)_flash_page_addr) + i * words_to_write, - (uint32_t *)_flash_cache + i * words_to_write, - words_to_write); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash write failed to start, err 0x%04x"), err_code); - } - status = sd_flash_operation_wait_until_done(); - if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash write failed")); - } - } - } else { -#endif - nrf_nvmc_page_erase(_flash_page_addr); - nrf_nvmc_write_words(_flash_page_addr, (uint32_t *)_flash_cache, FL_PAGE_SZ / sizeof(uint32_t)); -#ifdef BLUETOOTH_SD - } -#endif - - } - _flash_page_addr = NO_CACHE; -} - -void supervisor_flash_release_cache(void) { -} - mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { // Must write out anything in cache before trying to read. - supervisor_flash_flush(); + nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); + _flash_page_addr = NO_CACHE; + uint32_t src = lba2addr(block); memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); return 0; // success @@ -151,21 +83,21 @@ mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t n mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32_t num_blocks) { while (num_blocks) { uint32_t const addr = lba2addr(lba); - uint32_t const page_addr = addr & ~(FL_PAGE_SZ - 1); + uint32_t const page_addr = addr & ~(FLASH_PAGE_SIZE - 1); uint32_t count = 8 - (lba % 8); // up to page boundary count = MIN(num_blocks, count); if (page_addr != _flash_page_addr) { - supervisor_flash_flush(); - + nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); _flash_page_addr = page_addr; + // Copy the current contents of the entire page into the cache. - memcpy(_flash_cache, (void *)page_addr, FL_PAGE_SZ); + memcpy(_flash_cache, (void *)page_addr, FLASH_PAGE_SIZE); } // Overwrite part or all of the page cache with the src data. - memcpy(_flash_cache + (addr & (FL_PAGE_SZ - 1)), src, count * FILESYSTEM_BLOCK_SIZE); + memcpy(_flash_cache + (addr & (FLASH_PAGE_SIZE - 1)), src, count * FILESYSTEM_BLOCK_SIZE); // adjust for next run lba += count; diff --git a/ports/nrf/supervisor/internal_flash.h b/ports/nrf/supervisor/internal_flash.h index cf1dc91b5..7ea39f82e 100644 --- a/ports/nrf/supervisor/internal_flash.h +++ b/ports/nrf/supervisor/internal_flash.h @@ -32,7 +32,6 @@ #include "py/mpconfig.h" #define FLASH_PAGE_SIZE 0x1000 -#define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -- cgit v1.2.3 From fdaff00c78e69644eddf828b9b23795db168f8d4 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Thu, 4 Apr 2019 20:27:25 +1100 Subject: Make some space for NVM adafruit/circuitpython#1042 --- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 1 - ports/nrf/common-hal/nvm/ByteArray.c | 13 ++++++++++--- ports/nrf/peripherals/nrf/nvm.c | 5 ++--- ports/nrf/supervisor/internal_flash.c | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 8a700d610..2587a19e3 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -11,7 +11,6 @@ 0x000ED000..0x000F3FFF (28KB ) Private Config Data (Bonding, Keys, etc.) 0x000AD000..0x000ECFFF (256KB) User Filesystem - 0x00026000..0x000ACFFF (540KB) Application Code (including ISR vector) 0x00001000..0x00025FFF (148KB) SoftDevice 0x00000000..0x00000FFF (4KB) Master Boot Record diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index d69abbdac..ee270f79b 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -31,8 +31,15 @@ #include "peripherals/nrf/nvm.h" +// defined in linker +extern uint32_t __fatfs_flash_start_addr[]; +extern uint32_t __fatfs_flash_length[]; + +#define NVM_START_ADDR ((uint32_t)__fatfs_flash_start_addr + \ + (uint32_t)__fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) + uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { - return self->len; + return CIRCUITPY_INTERNAL_NVM_SIZE; } static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { @@ -52,7 +59,7 @@ static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { - uint32_t address = self->start_address + start_index; + uint32_t address = NVM_START_ADDR + start_index; uint32_t offset = address % FLASH_PAGE_SIZE; uint32_t page_addr = address - offset; @@ -69,5 +76,5 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, (uint8_t *)(self->start_address + start_index), len); + memcpy(values, (uint8_t *)(NVM_START_ADDR + start_index), len); } diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c index f9cc1b806..d8fddc4dc 100644 --- a/ports/nrf/peripherals/nrf/nvm.c +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -25,7 +25,6 @@ * THE SOFTWARE. */ -//#include "py/obj.h" #include "py/runtime.h" #include @@ -33,12 +32,12 @@ #include "nrf_nvmc.h" +#define FLASH_PAGE_SIZE (4096) + #ifdef BLUETOOTH_SD #include "ble_drv.h" #include "nrf_sdm.h" -#define FLASH_PAGE_SIZE (4096) - STATIC void sd_flash_operation_start(void) { sd_flash_operation_status = SD_FLASH_OPERATION_IN_PROGRESS; } diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index 9aaaf9b5d..016d97076 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,7 +67,7 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; + return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNVAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { -- cgit v1.2.3 From 18908c21f7998b13493fe75d0020bd9ad1bd1b60 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Tue, 9 Apr 2019 12:53:11 +1000 Subject: Fixups for adafruit/circuitpython#1042 --- ports/nrf/common-hal/microcontroller/__init__.c | 3 --- ports/nrf/peripherals/nrf/nvm.h | 6 ++++++ ports/nrf/supervisor/internal_flash.c | 18 +++++++++++++++--- ports/nrf/supervisor/internal_flash.h | 2 -- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 7055cb236..ab7b5d5d6 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -74,12 +74,9 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, }, - .len = CIRCUITPY_INTERNAL_NVM_SIZE, - .start_address = FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE }; #endif - STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_00), MP_ROM_PTR(&pin_P0_00) }, { MP_ROM_QSTR(MP_QSTR_P0_01), MP_ROM_PTR(&pin_P0_01) }, diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index e051bdbe5..4eac3d728 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -25,4 +25,10 @@ * THE SOFTWARE. */ +#define FLASH_PAGE_SIZE (4096) + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (0) +#endif + void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index 016d97076..5713dea88 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,13 +67,21 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNVAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; + return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; +} + +void supervisor_flash_flush(void) { + if (_flash_page_addr == NO_CACHE) return; + + // Skip if data is the same + if (memcmp(_flash_cache, (void *)_flash_page_addr, FLASH_PAGE_SIZE) != 0) { + nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); + } } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { // Must write out anything in cache before trying to read. - nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); - _flash_page_addr = NO_CACHE; + supervisor_flash_flush(); uint32_t src = lba2addr(block); memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); @@ -107,3 +115,7 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 return 0; // success } + +void supervisor_flash_release_cache(void) { +} + diff --git a/ports/nrf/supervisor/internal_flash.h b/ports/nrf/supervisor/internal_flash.h index 7ea39f82e..024a53ebb 100644 --- a/ports/nrf/supervisor/internal_flash.h +++ b/ports/nrf/supervisor/internal_flash.h @@ -31,8 +31,6 @@ #include "py/mpconfig.h" -#define FLASH_PAGE_SIZE 0x1000 - #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -- cgit v1.2.3 From 864910559bc712deed112e072f61fd482adea1a6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 10 Apr 2019 21:41:55 -0400 Subject: fix subscripting --- ports/nrf/common-hal/microcontroller/__init__.c | 2 ++ ports/nrf/common-hal/nvm/ByteArray.c | 23 ++++++++++------------- ports/nrf/common-hal/nvm/ByteArray.h | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index ab7b5d5d6..92aac772a 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -74,6 +74,8 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, }, + .len = CIRCUITPY_INTERNAL_NVM_SIZE, + .start_address = (uint8_t*) (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE), }; #endif diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index ee270f79b..4373e2502 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -35,37 +35,34 @@ extern uint32_t __fatfs_flash_start_addr[]; extern uint32_t __fatfs_flash_length[]; -#define NVM_START_ADDR ((uint32_t)__fatfs_flash_start_addr + \ - (uint32_t)__fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) - uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { - return CIRCUITPY_INTERNAL_NVM_SIZE; + return self->len; } -static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { - // Write a whole page to flash, buffering it first and then erasing and rewriting +static void write_page(uint8_t* page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { + // Write a whole page to flash, buffering it first and then erasing and rewriting // it since we can only clear a whole page at a time. if (offset == 0 && len == FLASH_PAGE_SIZE) { - nrf_nvm_safe_flash_page_write(page_addr, bytes); + nrf_nvm_safe_flash_page_write((uint32_t) page_addr, bytes); } else { uint8_t buffer[FLASH_PAGE_SIZE]; - memcpy(buffer, (uint8_t *)page_addr, FLASH_PAGE_SIZE); + memcpy(buffer, page_addr, FLASH_PAGE_SIZE); memcpy(buffer + offset, bytes, len); - nrf_nvm_safe_flash_page_write(page_addr, buffer); + nrf_nvm_safe_flash_page_write((uint32_t) page_addr, buffer); } } bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { - uint32_t address = NVM_START_ADDR + start_index; + uint32_t address = ((uint32_t) self->start_address) + start_index; uint32_t offset = address % FLASH_PAGE_SIZE; uint32_t page_addr = address - offset; while (len) { uint32_t write_len = MIN(len, FLASH_PAGE_SIZE - offset); - write_page(page_addr, offset, write_len, values); + write_page((uint8_t*) page_addr, offset, write_len, values); len -= write_len; values += write_len; page_addr += FLASH_PAGE_SIZE; @@ -75,6 +72,6 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, } void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, - uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, (uint8_t *)(NVM_START_ADDR + start_index), len); + uint32_t start_index, uint32_t len, uint8_t* values) { + memcpy(values, self->start_address + start_index, len); } diff --git a/ports/nrf/common-hal/nvm/ByteArray.h b/ports/nrf/common-hal/nvm/ByteArray.h index e47a87b9e..c048d5577 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.h +++ b/ports/nrf/common-hal/nvm/ByteArray.h @@ -31,7 +31,7 @@ typedef struct { mp_obj_base_t base; - uint32_t start_address; + uint8_t* start_address; uint32_t len; } nvm_bytearray_obj_t; -- cgit v1.2.3 From e3cfd1693cc10f27550caa1c358d040dcaeb6505 Mon Sep 17 00:00:00 2001 From: hexthat Date: Sat, 13 Apr 2019 10:13:41 -0700 Subject: Update zh_Latn_pinyin.po add translations --- locale/zh_Latn_pinyin.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 96fcdf73d..9ac2dab55 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -8,13 +8,14 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-12 13:44-0700\n" -"PO-Revision-Date: 2019-04-03 01:59-0700\n" +"PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.1\n" #: main.c msgid "" @@ -750,7 +751,7 @@ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Měi gè zhí de wèi wúxiào" #: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" @@ -910,7 +911,7 @@ msgstr "Méiyǒu kěyòng de shízhōng" #: shared-bindings/board/__init__.c msgid "No default %q bus" -msgstr "" +msgstr "wú mòrèn %q zǒngxiàn" #: ports/atmel-samd/common-hal/touchio/TouchIn.c msgid "No free GCLKs" @@ -2121,7 +2122,7 @@ msgstr "zhǎodào fēi shíliù jìn zhì shùzì" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "zài*/** zhīhòu fēi guānjiàn cí cānshù" +msgstr "zài */** zhīhòu fēi guānjiàn cí cānshù" #: py/compile.c msgid "non-keyword arg after keyword arg" @@ -2557,7 +2558,7 @@ msgstr "bùkě dú shǔxìng" #: shared-bindings/displayio/TileGrid.c msgid "unsupported %q type" -msgstr "" +msgstr "bù zhīchí %q lèixíng" #: py/emitinlinethumb.c #, c-format -- cgit v1.2.3 From e6e76a06b7a8ff6fd1e5e45ae651559a2b4bf49f Mon Sep 17 00:00:00 2001 From: Pierrick C Date: Sun, 14 Apr 2019 16:52:30 +0200 Subject: Contributions from OlivierDev (odeevee) + some new string --- locale/fr.po | 283 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 144 insertions(+), 139 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index a487e92bb..da6cff7c8 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -2,13 +2,14 @@ # Copyright (C) 2018 # This file is distributed under the same license as the PACKAGE package. # Pierrick Couturier , 2018. +# Olivier Deveault # msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-04-12 13:44-0700\n" -"PO-Revision-Date: 2018-12-23 20:05+0100\n" +"PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" "Language: fr\n" @@ -21,6 +22,8 @@ msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Fin d'éxecution du code. En attente de recharge.\n" #: py/obj.c msgid " File \"%q\"" @@ -55,7 +58,7 @@ msgstr "les indices %q doivent être des entiers, pas %s" #: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c #, fuzzy msgid "%q must be >= 1" -msgstr "les slices de tampon doivent être de longueurs égales" +msgstr "%d doit être >=1" #: shared-bindings/fontio/BuiltinFont.c #, fuzzy @@ -103,7 +106,7 @@ msgstr "'%s' attend un entier" #: py/emitinlinethumb.c #, fuzzy, c-format msgid "'%s' expects at most r%d" -msgstr "'%s' attend un registre" +msgstr "'%s' s'attend au plus à r%d" #: py/emitinlinethumb.c #, fuzzy, c-format @@ -216,17 +219,17 @@ msgstr "pow() avec 3 arguments non supporté" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "Un canal d'interruptions est déjà utilisé" +msgstr "Un canal d'interruptions matérielles est déjà utilisé" #: shared-bindings/bleio/Address.c #, c-format msgid "Address is not %d bytes long or is in wrong format" -msgstr "" +msgstr "L'adresse n'est pas longue de %d octets ou est d'un format erroné" #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" -msgstr "la palette doit être longue de 32 octets" +msgstr "L'adresse doit être longue de %d octets" #: ports/nrf/common-hal/busio/I2C.c #, fuzzy @@ -265,7 +268,7 @@ msgstr "Tous les timers sont utilisés" #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" -msgstr "AnalogOut non supporté" +msgstr "Fonction AnalogOut non supportée" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." @@ -294,7 +297,7 @@ msgstr "" #: main.c msgid "Auto-reload is off.\n" -msgstr "Auto-rechargement désactivé.\n" +msgstr "Auto-chargement désactivé.\n" #: main.c msgid "" @@ -314,7 +317,7 @@ msgstr "La profondeur de bit doit être un multiple de 8." #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "Les deux entrées doivent supporter les interruptions" +msgstr "Les deux entrées doivent supporter les interruptions matérielles" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -351,7 +354,7 @@ msgstr "Les octets 'bytes' doivent être entre 0 et 255" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Can not use dotstar with %s" -msgstr "" +msgstr "Impossible d'utiliser 'dotstar' avec %s" #: shared-bindings/bleio/Device.c msgid "Can't add services in Central mode" @@ -359,7 +362,7 @@ msgstr "Impossible d'ajouter des service en mode Central" #: shared-bindings/bleio/Device.c msgid "Can't advertise in Central mode" -msgstr "" +msgstr "Impossible de publier en mode Central" #: shared-bindings/bleio/Device.c msgid "Can't change the name in Central mode" @@ -376,12 +379,12 @@ msgstr "Impossible de supprimer les valeurs" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "Ne peux être tiré ('pull') en mode 'output'" +msgstr "Ne peut être tiré ('pull') en mode 'output'" #: ports/nrf/common-hal/microcontroller/Processor.c #, fuzzy msgid "Cannot get temperature" -msgstr "Impossible de lire la température. status: 0x%02x" +msgstr "Impossible de lire la température" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -410,7 +413,7 @@ msgstr "Impossible d'affecter une valeur quand la direction est 'input'." #: py/objslice.c msgid "Cannot subclass slice" -msgstr "On ne peut faire de subclass de slice" +msgstr "On ne peut faire de sous-classes de tranches" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -426,15 +429,15 @@ msgstr "Impossible d'écrire sans broche MOSI." #: shared-bindings/bleio/Service.c msgid "Characteristic UUID doesn't match Service UUID" -msgstr "" +msgstr "L'UUID de 'Characteristic' ne correspond pas à l'UUID de service" #: ports/nrf/common-hal/bleio/Service.c msgid "Characteristic already in use by another Service." -msgstr "" +msgstr "'Characteristic' déjà en utilisation par un autre service" #: shared-bindings/bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -460,7 +463,7 @@ msgstr "Les octets 'bytes' doivent être entre 0 et 255" #: ports/nrf/common-hal/bleio/UUID.c #, c-format msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" +msgstr "Impossible de décoder le 'ble_uuid', err 0x%04x" #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -476,7 +479,7 @@ msgstr "Impossible d'allouer le 2e tampon" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler.\n" -msgstr "" +msgstr "Plantage vers le HardFault_Handler.\n" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -495,11 +498,11 @@ msgstr "Un bloc de données doit suivre un bloc de format" #: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "Données trop volumineuses pour un paquet de diffusion" #: ports/nrf/common-hal/bleio/Device.c msgid "Data too large for the advertisement packet" -msgstr "" +msgstr "Données trop volumineuses pour le paquet de diffusion" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -531,43 +534,43 @@ msgstr "Attendu : %q" #: shared-bindings/bleio/CharacteristicBuffer.c #, fuzzy msgid "Expected a Characteristic" -msgstr "Impossible d'ajouter la Characteristic." +msgstr "Une 'Characteristic' est attendue" #: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c #: shared-bindings/bleio/Service.c #, fuzzy msgid "Expected a UUID" -msgstr "Attendu : %q" +msgstr "Un UUID est attendu" #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" -msgstr "" +msgstr "Tuple de longueur %d attendu, obtenu %d" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" -msgstr "Echec de l'obtention de mutex, status: 0x%08lX" +msgstr "Echec de l'obtention de mutex" #: ports/nrf/common-hal/bleio/Characteristic.c ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "Echec de l'obtention de mutex, status: 0x%08lX" +msgstr "Echec de l'obtention de mutex, err 0x%04x" #: ports/nrf/common-hal/bleio/Service.c #, fuzzy, c-format msgid "Failed to add characteristic, err 0x%04x" -msgstr "Echec de l'ajout de caractéristique, statut: 0x%08lX" +msgstr "Echec de l'ajout de caractéristique, err 0x%04x" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to add service" -msgstr "Echec de l'ajout de service, statut: 0x%08lX" +msgstr "Echec de l'ajout de service" #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to add service, err 0x%04x" -msgstr "Echec de l'ajout de service, statut: 0x%08lX" +msgstr "Echec de l'ajout de service, err 0x%04x" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -587,114 +590,114 @@ msgstr "Echec de la modification de l'état du périph., erreur: 0x%08lX" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to connect:" -msgstr "Connection impossible. statut: 0x%08lX" +msgstr "Echec de connection:" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to continue scanning" -msgstr "Impossible de commencer à scanner. statut: 0x%0xlX" +msgstr "Impossible de poursuivre le scan" #: ports/nrf/common-hal/bleio/Scanner.c #, fuzzy, c-format msgid "Failed to continue scanning, err 0x%04x" -msgstr "Impossible de commencer à scanner. statut: 0x%0xlX" +msgstr "Impossible de poursuivre le scan, err 0x%04x" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to create mutex" -msgstr "Echec de la création de mutex, statut: 0x%0xlX" +msgstr "Echec de la création de mutex" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to discover services" -msgstr "Echec de la découverte de services, statut: 0x%08lX" +msgstr "Echec de la découverte de services" #: ports/nrf/common-hal/bleio/Adapter.c #, fuzzy msgid "Failed to get local address" -msgstr "Echec de l'obtention de l'adresse locale, erreur: 0x%08lX" +msgstr "Echec de l'obtention de l'adresse locale" #: ports/nrf/common-hal/bleio/Adapter.c #, fuzzy msgid "Failed to get softdevice state" -msgstr "Echec de l'obtention de l'état du périph., erreur: 0x%08lX" +msgstr "Echec de l'obtention de l'état du périph." #: ports/nrf/common-hal/bleio/Characteristic.c #, c-format msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" +msgstr "Impossible de notifier ou indicate la valeur de l'attribut, err 0x%04x" #: ports/nrf/common-hal/bleio/Characteristic.c #, fuzzy, c-format msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Impossible de lire la valeur de l'attribut. status: 0x%08lX" +msgstr "Impossible de lire la valeur 'CCCD', err 0x%04x" #: ports/nrf/common-hal/bleio/Characteristic.c #, c-format msgid "Failed to read attribute value, err 0x%04x" -msgstr "" +msgstr "Impossible de lire la valeur de l'attribut, err 0x%04x" #: ports/nrf/common-hal/bleio/Characteristic.c #, fuzzy, c-format msgid "Failed to read gatts value, err 0x%04x" -msgstr "Impossible d'écrire la valeur de gatts. status: 0x%08lX" +msgstr "Impossible de lire la valeur de 'gatts', err 0x%04x" #: ports/nrf/common-hal/bleio/UUID.c #, fuzzy, c-format msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Echec de l'ajout de l'UUID Vendor Specific, , statut: 0x%08lX" +msgstr "Echec de l'ajout de l'UUID du fournisseur, err 0x%04x" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to release mutex" -msgstr "Impossible de libérer mutex, status: 0x%08lX" +msgstr "Impossible de libérer mutex" #: ports/nrf/common-hal/bleio/Characteristic.c ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "Impossible de libérer mutex, status: 0x%08lX" +msgstr "Impossible de libérer mutex, err 0x%04x" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to start advertising" -msgstr "Echec de l'ajout de service, statut: 0x%08lX" +msgstr "Echec du démarrage de la diffusion" #: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" -msgstr "Impossible de commencer à scanner, statut: 0x%0xlX" +msgstr "Impossible de commencer à diffuser, err 0x%04x" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to start scanning" -msgstr "Impossible de commencer à scanner, statut: 0x%0xlX" +msgstr "Impossible de commencer à scanner" #: ports/nrf/common-hal/bleio/Scanner.c #, fuzzy, c-format msgid "Failed to start scanning, err 0x%04x" -msgstr "Impossible de commencer à scanner, statut: 0x%0xlX" +msgstr "Impossible de commencer à scanner, err 0x%04x" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to stop advertising" -msgstr "Echec de l'ajout de service, statut: 0x%08lX" +msgstr "Echec de l'arrêt de diffusion" #: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" -msgstr "Echec de l'ajout de service, statut: 0x%08lX" +msgstr "Echec de l'arrêt de diffusion, err 0x%04x" #: ports/nrf/common-hal/bleio/Characteristic.c #, fuzzy, c-format msgid "Failed to write attribute value, err 0x%04x" -msgstr "Impossible d'écrire la valeur de l'attribut. status: 0x%08lX" +msgstr "Impossible d'écrire la valeur de l'attribut, err 0x%04x" #: ports/nrf/common-hal/bleio/Characteristic.c #, fuzzy, c-format msgid "Failed to write gatts value, err 0x%04x" -msgstr "Impossible d'écrire la valeur de gatts. status: 0x%08lX" +msgstr "Impossible d'écrire la valeur de 'gatts', err 0x%04x" #: py/moduerrno.c msgid "File exists" @@ -744,12 +747,12 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Fichier .mpy incompatible. Merci de mettre à jour tous les .mpy. Voirhttp://" -"adafru.it/mpy-update pour plus d'informations." +"Fichier .mpy incompatible. Merci de mettre à jour tous les .mpy. Voir" +" http://adafru.it/mpy-update pour plus d'informations." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Taille de tampon incorrecte" #: py/moduerrno.c msgid "Input/output error" @@ -758,7 +761,7 @@ msgstr "Erreur d'entrée/sortie" #: shared-module/displayio/OnDiskBitmap.c #, fuzzy msgid "Invalid BMP file" -msgstr "Fichier invalide" +msgstr "Fichier BMP invalide" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c @@ -780,16 +783,16 @@ msgstr "" #: ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" -msgstr "longueur de tampon invalide" +msgstr "Longueur de tampon invalide" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "Période de capture invalide. Gamme valide: 1 à 500" #: shared-bindings/audioio/Mixer.c #, fuzzy msgid "Invalid channel count" -msgstr "Argument invalide" +msgstr "Nombre de canaux invalide" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid clock pin" @@ -853,7 +856,7 @@ msgstr "Mode de lancement invalide" #: shared-bindings/audioio/Mixer.c #, fuzzy msgid "Invalid voice count" -msgstr "Type de service invalide" +msgstr "Nombre de voix invalide" #: shared-module/audioio/WaveFile.c msgid "Invalid wave file" @@ -865,11 +868,11 @@ msgstr "La partie gauche de l'argument nommé doit être un identifiant" #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'." #: py/objslice.c msgid "Length must be an int" -msgstr "La longueur doit être entière" +msgstr "La longueur doit être un nombre entier" #: py/objslice.c msgid "Length must be non-negative" @@ -901,7 +904,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "" +msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error.\n" @@ -913,7 +916,7 @@ msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" #: shared-bindings/displayio/Display.c msgid "Must be a Group subclass." -msgstr "" +msgstr "Doit être une sous-classe de 'Group'" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" @@ -964,7 +967,7 @@ msgstr "Fichier/dossier introuvable" #: shared-bindings/bleio/CharacteristicBuffer.c #, fuzzy msgid "Not connected" -msgstr "Impossible de se connecter à 'AP'" +msgstr "Non connecté" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c msgid "Not playing" @@ -980,7 +983,7 @@ msgstr "" #: ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "Odd parity is not supported" -msgstr "parité impaire non supportée" +msgstr "Parité impaire non supportée" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -991,6 +994,8 @@ msgstr "Uniquement 8 ou 16 bit mono avec " msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"Seul le format BMP Windows, non compressé est supporté: la taille de l'entête" +"fournie est %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -998,11 +1003,12 @@ msgid "" "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d bpp " "given" msgstr "" +"Seul les BMP monochrome, 8bit indexé et 16bit sont supportés: %d bpp fourni" #: shared-bindings/_pixelbuf/PixelBuf.c #, fuzzy msgid "Only slices with step=1 (aka None) are supported" -msgstr "seuls les slices avec 'step=1' (cad None) sont supportées" +msgstr "seuls les slices avec 'step=1' (cad 'None') sont supportées" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1030,16 +1036,16 @@ msgstr "Permission refusée" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" -msgstr "la broche ne peut être utilisé pour l'ADC" +msgstr "La broche ne peut être utilisée pour l'ADC" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Pixel beyond bounds of buffer" -msgstr "" +msgstr "Pixel au-delà des limites du tampon" #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" -msgstr "Impossible de remonter le système de fichiers" +msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." @@ -1051,7 +1057,7 @@ msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." #: ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "calibration de la RTC non supportée sur cette carte" +msgstr "étalonnage de la RTC non supportée sur cette carte" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" @@ -1085,7 +1091,7 @@ msgstr "" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Mode sans-échec. Auto-rechargement désactivé.\n" +msgstr "Mode sans-échec. Auto-chargement désactivé.\n" #: main.c msgid "Running in safe mode! Not running saved code.\n" @@ -1098,7 +1104,7 @@ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" #: shared-bindings/audioio/Mixer.c #, fuzzy msgid "Sample rate must be positive" -msgstr "le taux d'échantillonage doit être positif" +msgstr "Le taux d'échantillonage doit être positif" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1112,21 +1118,21 @@ msgstr "Sérialiseur en cours d'utilisation" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "Slice et valeur de tailles différentes" +msgstr "Tranche et valeur de tailles différentes" #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "Slices non supportées" +msgstr "Tranches non supportées" #: ports/nrf/common-hal/bleio/Adapter.c #, c-format msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" -msgstr "" +msgstr "Assertion en mode 'soft-device', id: 0x%08lX, pc: 0x%08lX" #: extmod/modure.c msgid "Splitting with sub-captures" -msgstr "Fractionnement avec des captures 'sub'" +msgstr "Fractionnement avec des sous-captures" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" @@ -1144,10 +1150,10 @@ msgid "" "If you didn't change the stack, then file an issue here with the contents of " "your CIRCUITPY drive:\n" msgstr "" -"La pile de CircuitPython a été corrompue parce que la pile était trop " +"Le tas (heap) de CircuitPython a été corrompu parce que la pile était trop " "petite.\n" "Augmentez la limite de taille de la pile et appuyez sur 'reset' (après avoir " -"éjecter CIRCUITPY).\n" +"éjecté CIRCUITPY).\n" "Si vous n'avez pas modifié la pile, merci de remplir un ticket avec le " "contenu de votre lecteur CIRCUITPY :\n" @@ -1162,7 +1168,7 @@ msgstr "" "L'alimentation du microcontroleur a chuté. Merci de vérifier que votre " "alimentation fournit\n" "suffisamment de puissance pour l'ensemble du circuit et appuyez sur " -"'reset' (après avoir éjecter CIRCUITPY).\n" +"'reset' (après avoir éjecté CIRCUITPY).\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1170,7 +1176,7 @@ msgid "" "exit safe mode.\n" msgstr "" "Le bouton 'reset' a été appuyé pendant le démarrage de CircuitPython. " -"Appuyer denouveau pour quitter de le mode sans-échec.\n" +"Appuyer de nouveau pour quitter de le mode sans-échec.\n" #: shared-module/audioio/Mixer.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1234,15 +1240,15 @@ msgstr "Erreur USB" #: shared-bindings/bleio/UUID.c msgid "UUID integer value not in range 0 to 0xffff" -msgstr "" +msgstr "valeur de l'entier UUID est hors-bornes 0 à 0xffff" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "la chaîne UUID n'est pas du format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "la valeur de l'UUID n'est pas une chaîne de caractères, un entier ou un tampon d'octets" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1264,17 +1270,17 @@ msgstr "" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "Impossible d'écrire sur la nvm." +msgstr "Impossible d'écrire sur la mémoire non-volatile." #: ports/nrf/common-hal/bleio/UUID.c #, fuzzy msgid "Unexpected nrfx uuid type" -msgstr "indentation inattendue" +msgstr "Type nrfx uuid inattendu" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" +msgstr "Pas de correspondance du nombres d'éléments de RHS (attendu %d, obtenu %d)" #: ports/atmel-samd/common-hal/busio/I2C.c msgid "Unsupported baudrate" @@ -1395,7 +1401,7 @@ msgstr "attribut pas encore supporté" #: ports/nrf/common-hal/bleio/Characteristic.c msgid "bad GATT role" -msgstr "" +msgstr "mauvais rôle GATT" #: py/builtinevex.c msgid "bad compile mode" @@ -1428,17 +1434,17 @@ msgstr "les bits doivent être 8" #: shared-bindings/audioio/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" -msgstr "bits doivent être 8 ou 16" +msgstr "'bits_per_sample' doivent être 8 ou 16" #: py/emitinlinethumb.c #, fuzzy msgid "branch not in range" -msgstr "argument de chr() hors de la gamme range(256)" +msgstr "branche hors-bornes" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "buf is too small. need %d bytes" -msgstr "" +msgstr "'buf' est trop petit. Besoin de %b octets" #: shared-bindings/audioio/RawSample.c msgid "buffer must be a bytes-like object" @@ -1451,7 +1457,7 @@ msgstr "les slices de tampon doivent être de longueurs égales" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "les slices de tampon doivent être de longueurs égales" +msgstr "les tranches de tampon doivent être de longueurs égales" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c @@ -1481,27 +1487,27 @@ msgstr "octets > 8 bits non supporté" #: py/objstr.c msgid "bytes value out of range" -msgstr "valeur des octets hors gamme" +msgstr "valeur des octets hors bornes" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" -msgstr "calibration hors gamme" +msgstr "étalonnage hors bornes" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is read only" -msgstr "calibration en lecture seule" +msgstr "étalonnage en lecture seule" #: ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration value out of range +/-127" -msgstr "valeur de calibration hors gamme +/-127" +msgstr "valeur de étalonnage hors bornes +/-127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "il peut y avoir jusqu'à 4 paramètres pour Thumb assembly" +msgstr "il peut y avoir jusqu'à 4 paramètres pour l'assemblage Thumb" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "Maximum 4 paramètres pour l'assembleur Xtensa" +msgstr "maximum 4 paramètres pour l'assembleur Xtensa" #: py/persistentcode.c msgid "can only save bytecode" @@ -1509,8 +1515,7 @@ msgstr "ne peut sauvegarder que du bytecode" #: py/objtype.c msgid "can't add special method to already-subclassed class" -msgstr "" -"impossible d'ajouter une méthode spécial à une classe déjà sous-classée" +msgstr "impossible d'ajouter une méthode spéciale à une classe déjà sous-classée" #: py/compile.c msgid "can't assign to expression" @@ -1602,12 +1607,12 @@ msgstr "impossible de charger avec l'index '%q'" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "on ne peut effectuer une action de type 'pend throw' à un générateur fraîchement démarré" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" -"on ne peut envoyer une valeur autre que None à un générateur fraîchement " +"on ne peut envoyer une valeur autre que 'None' à un générateur fraîchement " "démarré" #: py/objnamedtuple.c @@ -1662,7 +1667,7 @@ msgstr "typage" #: shared-bindings/bleio/Service.c msgid "characteristics includes an object that is not a Characteristic" -msgstr "" +msgstr "'characteristics' inclut un objet qui n'est pas une 'Characteristic'" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -1715,7 +1720,7 @@ msgstr "entête de compression" #: py/parse.c msgid "constant must be an integer" -msgstr "une constante doit être un entier" +msgstr "constante doit être un entier" #: py/emitnative.c msgid "conversion to object" @@ -1759,7 +1764,7 @@ msgstr "vide" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "'heap' vide" +msgstr "tas vide" #: py/objstr.c msgid "empty separator" @@ -1809,19 +1814,19 @@ msgstr "une instruction assembleur est attendue" #: py/compile.c msgid "expecting just a value for set" -msgstr "une simple valeur est attendue pour set" +msgstr "une simple valeur est attendue pour l'ensemble 'set'" #: py/compile.c msgid "expecting key:value for dict" -msgstr "couple clef:valeur attendu pour un objet dict" +msgstr "couple clef:valeur attendu pour un dictionnaire 'dict'" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "argument nommé donné en plus" +msgstr "argument(s) nommé(s) supplémentaire(s) donné(s)" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "argument positionnel donné en plus" +msgstr "argument(s) positionnel(s) supplémentaire(s) donné(s)" #: shared-bindings/audioio/WaveFile.c shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -1841,11 +1846,11 @@ msgstr "le 1er bit doit être le MSB" #: py/objint.c msgid "float too big" -msgstr "nombre flottant trop grand" +msgstr "nombre à virgule flottante trop grand" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "la fonte doit être longue de 2048 octets" +msgstr "la police doit être longue de 2048 octets" #: py/objstr.c msgid "format requires a dict" @@ -1884,7 +1889,7 @@ msgstr "il manque l'argument nommé obligatoire '%q'" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "il manque l'argument obligatoire #%d" +msgstr "il manque l'argument positionnel obligatoire #%d" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format @@ -1909,7 +1914,7 @@ msgstr "le graphic doit être long de 2048 octets" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "'heap' doit être une liste" +msgstr "le tas doit être une liste" #: py/compile.c msgid "identifier redefined as global" @@ -1954,7 +1959,7 @@ msgstr "entier requis" #: ports/nrf/common-hal/bleio/Broadcaster.c msgid "interval not in range 0.0020 to 10.24" -msgstr "" +msgstr "intervalle hors bornes (0.0020 à 10.24)" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2024,7 +2029,7 @@ msgstr "" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" -msgstr "join attend une liste d'objets str/bytes cohérent avec l'objet self" +msgstr "'join' s'attend à une liste d'objets str/bytes cohérents avec l'objet self" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" @@ -2045,7 +2050,7 @@ msgstr "label redéfini" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "argument lenght non permis pour ce type" +msgstr "argument 'length' non-permis pour ce type" #: py/objarray.c msgid "lhs and rhs should be compatible" @@ -2086,7 +2091,7 @@ msgstr "l'allocation de mémoire a échoué en allouant %u octets" #: py/runtime.c msgid "memory allocation failed, heap is locked" -msgstr "l'allocation de mémoire a échoué, la pile est vérrouillé" +msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" #: py/builtinimport.c msgid "module not found" @@ -2102,7 +2107,7 @@ msgstr "de multiple bases ont un conflit de lay-out d'instance" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "héritage multiple non supporté" +msgstr "héritage multiple non supportée" #: py/emitnative.c msgid "must raise an object" @@ -2114,7 +2119,7 @@ msgstr "SCK, MOSI et MISO doivent tous être spécifiés" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "il faut utiliser un argument nommé pour une fonction key" +msgstr "doit utiliser un argument nommé pour une fonction key" #: py/runtime.c msgid "name '%q' is not defined" @@ -2144,7 +2149,7 @@ msgstr "nécessite plus de %d valeur à dégrouper" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "puissance négative sans support des nombres flottants" +msgstr "puissance négative sans support des nombres à virgules flottantes" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" @@ -2157,7 +2162,7 @@ msgstr "aucune exception active à relever" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c #, fuzzy msgid "no available NIC" -msgstr "NIC non disponible" +msgstr "adapteur réseau non disponible" #: py/compile.c msgid "no binding for nonlocal found" @@ -2178,7 +2183,7 @@ msgstr "" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "digit non-héxadécimale trouvé" +msgstr "chiffre non-héxadécimale trouvé" #: py/compile.c msgid "non-keyword arg after */**" @@ -2190,7 +2195,7 @@ msgstr "argument non-nommé après argument nommé" #: shared-bindings/bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "n'est pas un UUID 128 bits" #: py/objstr.c msgid "not all arguments converted during string formatting" @@ -2245,7 +2250,7 @@ msgstr "l'objet de type '%s' n'a pas de len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "un objet avec un protocol de tampon est nécessaire" +msgstr "un objet avec un protocole de tampon est nécessaire" #: extmod/modubinascii.c msgid "odd-length string" @@ -2259,7 +2264,7 @@ msgstr "adresse hors limites" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" -msgstr "seuls les slices avec 'step=1' (cad None) sont supportées" +msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" #: py/modbuiltins.c msgid "ord expects a character" @@ -2268,7 +2273,7 @@ msgstr "ord attend un caractère" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "ord() attend un caractère mais une chaîne de longueur %d a été trouvée" +msgstr "ord() attend un caractère mais une chaîne de caractère de longueur %d a été trouvée" #: py/objint_mpz.c msgid "overflow converting long int to machine word" @@ -2383,15 +2388,15 @@ msgstr "taux d'échantillonage hors gamme" #: py/modmicropython.c msgid "schedule stack full" -msgstr "pile de plannification pleine" +msgstr "pile de planification pleine" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "compilation de script non supporté" +msgstr "compilation de script non supportée" #: shared-bindings/bleio/Peripheral.c msgid "services includes an object that is not a Service" -msgstr "" +msgstr "'services' inclut un object qui n'est pas un 'Service'" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -2411,7 +2416,7 @@ msgstr "la longueur de sleep ne doit pas être négative" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "le pas 'step' de slice ne peut être zéro" +msgstr "le pas 'step' de la tranche ne peut être zéro" #: py/objint.c py/sequence.c msgid "small int overflow" @@ -2511,11 +2516,11 @@ msgstr "timeout >100 (exprimé en secondes, pas en ms)" #: shared-bindings/bleio/CharacteristicBuffer.c #, fuzzy msgid "timeout must be >= 0.0" -msgstr "les bits doivent être 8" +msgstr "'timeout' doit être >=0.0" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "timestamp hors gamme pour time_t de la plateforme" +msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" #: shared-bindings/gamepad/GamePad.c msgid "too many arguments" @@ -2544,7 +2549,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "tx et rx ne peuvent être None tous les deux" +msgstr "tx et rx ne peuvent être 'None' tous les deux" #: py/objtype.c msgid "type '%q' is not an acceptable base type" @@ -2576,11 +2581,11 @@ msgstr "indentation inattendue" #: py/bc.c msgid "unexpected keyword argument" -msgstr "argument nommé imprévu" +msgstr "argument nommé inattendu" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "argument nommé '%q' imprévu" +msgstr "argument nommé '%q' inattendu" #: py/lexer.c msgid "unicode name escapes" @@ -2712,7 +2717,7 @@ msgstr "'step' nul" #~ msgstr "Ne sais pas comment passer l'objet à une fonction native" #~ msgid "ESP8226 does not support safe mode." -#~ msgstr "l'ESP8266 ne supporte pas le mode sans-échec" +#~ msgstr "L'ESP8266 ne supporte pas le mode sans-échec" #~ msgid "ESP8266 does not support pull down." #~ msgstr "L'ESP8266 ne supporte pas le rappel (pull-down)" @@ -2732,7 +2737,7 @@ msgstr "'step' nul" #~ msgstr "La fonction nécessite un verrou." #~ msgid "GPIO16 does not support pull up." -#~ msgstr "le GPIO16 ne supporte pas le tirage (pull-up)" +#~ msgstr "Le GPIO16 ne supporte pas le tirage (pull-up)" #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "La fréquence de PWM maximale est %dHz" @@ -2794,7 +2799,7 @@ msgstr "'step' nul" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "" -#~ "Utilisez 'esptool' pour effacer la flash et rechargez Python à la place" +#~ "Utilisez 'esptool' pour effacer la flash et recharger Python à la place" #~ msgid "buffer too long" #~ msgstr "tampon trop long" @@ -2821,7 +2826,7 @@ msgstr "'step' nul" #~ msgstr "une broche (Pin) est attendue" #~ msgid "flash location must be below 1MByte" -#~ msgstr "l'emplacement en mémoire flash doit être inférieure à 1Mo" +#~ msgstr "l'emplacement en mémoire flash doit être inférieur à 1Mo" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la fréquence doit être soit 80MHz soit 160MHz" @@ -2868,7 +2873,7 @@ msgstr "'step' nul" #~ msgstr "paramètre de config. inconnu" #~ msgid "unknown status param" -#~ msgstr "paramètre de status inconnu" +#~ msgstr "paramètre de statut inconnu" #~ msgid "wifi_set_ip_info() failed" #~ msgstr "wifi_set_ip_info() a échoué" -- cgit v1.2.3 From 75c7dc486afad3e851baf5b134fc228b5f0e534c Mon Sep 17 00:00:00 2001 From: Pierrick C Date: Sun, 14 Apr 2019 23:03:05 +0200 Subject: Add new translations + spell checking --- locale/fr.po | 249 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 119 insertions(+), 130 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index da6cff7c8..1ada5941f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -40,7 +40,7 @@ msgstr " sortie:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "%%c nécessite un entier int ou un caractère char" +msgstr "%%c nécessite un entier 'int' ou un caractère 'char'" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -67,7 +67,7 @@ msgstr "y doit être un entier (int)" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "%q() prend %d arguments mais %d ont été donnés" +msgstr "%q() prend %d arguments positionnels mais %d ont été donnés" #: py/argcheck.c msgid "'%q' argument required" @@ -145,12 +145,12 @@ msgstr "l'objet '%s' n'est pas un itérateur" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "objet '%s' non appelable" +msgstr "objet '%s' n'est pas appelable" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "objet '%s' non itérable" +msgstr "objet '%s' n'est pas itérable" #: py/obj.c #, c-format @@ -215,7 +215,7 @@ msgstr "0.0 à une puissance complexe" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "pow() avec 3 arguments non supporté" +msgstr "pow() non supporté avec 3 arguments" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" @@ -268,16 +268,15 @@ msgstr "Tous les timers sont utilisés" #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" -msgstr "Fonction AnalogOut non supportée" +msgstr "Fonctionnalité AnalogOut non supportée" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" -"AnalogOut est seulement 16 bits. Les valeurs doivent être inf. à 65536." +msgstr "AnalogOut est seulement 16 bits. Les valeurs doivent être inf. à 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut n'est pas supporté sur la broche indiquée" +msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c msgid "Another send is already active" @@ -285,7 +284,7 @@ msgstr "Un autre envoi est déjà actif" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "Le tableau doit contenir des halfwords (type 'H')" +msgstr "Le tableau doit contenir des demi-mots (type 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." @@ -293,11 +292,11 @@ msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running.\n" -msgstr "" +msgstr "Tentative d'allocation de tas alors que la VM MicroPython ne tourne pas.\n" #: main.c msgid "Auto-reload is off.\n" -msgstr "Auto-chargement désactivé.\n" +msgstr "L'auto-chargement est désactivé.\n" #: main.c msgid "" @@ -325,7 +324,7 @@ msgstr "La luminosité doit être entre 0 et 255" #: shared-bindings/displayio/Display.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Luminosité non-ajustable" #: shared-module/usb_hid/Device.c #, c-format @@ -340,12 +339,12 @@ msgstr "Le tampon doit être de longueur au moins 1" #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format msgid "Bus pin %d is already in use" -msgstr "DAC déjà utilisé" +msgstr "La broche %d du bus est déjà utilisée" #: shared-bindings/bleio/UUID.c #, fuzzy msgid "Byte buffer must be 16 bytes." -msgstr "le tampon doit être un objet bytes-like" +msgstr "Le tampon d'octets doit être de 16 octets." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -358,7 +357,7 @@ msgstr "Impossible d'utiliser 'dotstar' avec %s" #: shared-bindings/bleio/Device.c msgid "Can't add services in Central mode" -msgstr "Impossible d'ajouter des service en mode Central" +msgstr "Impossible d'ajouter des services en mode Central" #: shared-bindings/bleio/Device.c msgid "Can't advertise in Central mode" @@ -370,7 +369,7 @@ msgstr "Modification du nom impossible en mode Central" #: shared-bindings/bleio/Device.c msgid "Can't connect in Peripheral mode" -msgstr "Impossible de se connecter en mode Peripheral" +msgstr "Impossible de se connecter en mode 'Peripheral'" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -404,8 +403,7 @@ msgstr "'/' ne peut être remonté quand l'USB est actif." #: ports/atmel-samd/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "" -"Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." +msgstr "Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -417,7 +415,7 @@ msgstr "On ne peut faire de sous-classes de tranches" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Pas de transfert sans broches MOSI et MISO" +msgstr "Pas de transfert sans broches MOSI et MISO." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" @@ -429,7 +427,7 @@ msgstr "Impossible d'écrire sans broche MOSI." #: shared-bindings/bleio/Service.c msgid "Characteristic UUID doesn't match Service UUID" -msgstr "L'UUID de 'Characteristic' ne correspond pas à l'UUID de service" +msgstr "L'UUID de 'Characteristic' ne correspond pas à l'UUID du Service" #: ports/nrf/common-hal/bleio/Service.c msgid "Characteristic already in use by another Service." @@ -453,12 +451,12 @@ msgstr "Horloge en cours d'utilisation" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "L'entrée 'Column' doit être un digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/ParallelBus.c #, fuzzy msgid "Command must be an int between 0 and 255" -msgstr "Les octets 'bytes' doivent être entre 0 et 255" +msgstr "La commande doit être un entier entre 0 et 255" #: ports/nrf/common-hal/bleio/UUID.c #, c-format @@ -479,7 +477,7 @@ msgstr "Impossible d'allouer le 2e tampon" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler.\n" -msgstr "Plantage vers le HardFault_Handler.\n" +msgstr "Plantage vers le 'HardFault_Handler'.\n" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -489,7 +487,7 @@ msgstr "DAC déjà utilisé" #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy msgid "Data 0 pin must be byte aligned" -msgstr "le graphic doit être long de 2048 octets" +msgstr "La broche 'Data 0' doit être aligné sur l'octet" #: shared-module/audioio/WaveFile.c msgid "Data chunk must follow fmt chunk" @@ -506,11 +504,11 @@ msgstr "Données trop volumineuses pour le paquet de diffusion" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "La capacité de la cible est plus petite que destination_length." +msgstr "La capacité de destination est plus petite que 'destination_length'." #: shared-bindings/displayio/Display.c msgid "Display rotation must be in 90 degree increments" -msgstr "" +msgstr "La rotation d'affichage doit se faire par incréments de 90 degrés" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." @@ -529,7 +527,7 @@ msgstr "Erreur dans l'expression régulière" #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" -msgstr "Attendu : %q" +msgstr "Attendu un %q" #: shared-bindings/bleio/CharacteristicBuffer.c #, fuzzy @@ -585,7 +583,7 @@ msgstr "Echec de l'allocation de %d octets du tampon RX" #: ports/nrf/common-hal/bleio/Adapter.c #, fuzzy msgid "Failed to change softdevice state" -msgstr "Echec de la modification de l'état du périph., erreur: 0x%08lX" +msgstr "Echec de la modification de l'état du périphérique" #: ports/nrf/common-hal/bleio/Device.c #, fuzzy @@ -620,12 +618,12 @@ msgstr "Echec de l'obtention de l'adresse locale" #: ports/nrf/common-hal/bleio/Adapter.c #, fuzzy msgid "Failed to get softdevice state" -msgstr "Echec de l'obtention de l'état du périph." +msgstr "Echec de l'obtention de l'état du périphérique" #: ports/nrf/common-hal/bleio/Characteristic.c #, c-format msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "Impossible de notifier ou indicate la valeur de l'attribut, err 0x%04x" +msgstr "Impossible de notifier ou d'indiquer la valeur de l'attribut, err 0x%04x" #: ports/nrf/common-hal/bleio/Characteristic.c #, fuzzy, c-format @@ -705,25 +703,25 @@ msgstr "Le fichier existe" #: ports/nrf/supervisor/internal_flash.c msgid "Flash erase failed" -msgstr "" +msgstr "L'effacement de la flash a échoué" #: ports/nrf/supervisor/internal_flash.c #, c-format msgid "Flash erase failed to start, err 0x%04x" -msgstr "" +msgstr "Echec du démarrage de l'effacement de la flash, err 0x%04x" #: ports/nrf/supervisor/internal_flash.c msgid "Flash write failed" -msgstr "" +msgstr "L'écriture de la flash échoué" #: ports/nrf/supervisor/internal_flash.c #, c-format msgid "Flash write failed to start, err 0x%04x" -msgstr "" +msgstr "Echec du démarrage de l'écriture de la flash, err 0x%04x" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." -msgstr "" +msgstr "La fréquence capturée est au delà des capacités. Capture en pause." #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -747,8 +745,8 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Fichier .mpy incompatible. Merci de mettre à jour tous les .mpy. Voir" -" http://adafru.it/mpy-update pour plus d'informations." +"Fichier .mpy incompatible. Merci de mettre à jour tous les fichiers .mpy." +"Voir http://adafru.it/mpy-update pour plus d'informations." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -778,7 +776,7 @@ msgstr "Broche invalide pour 'bit clock'" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Bits par valeur invalides" #: ports/nrf/common-hal/busio/UART.c #, fuzzy @@ -851,7 +849,7 @@ msgstr "Polarité invalide" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "Mode de lancement invalide" +msgstr "Mode de lancement invalide." #: shared-bindings/audioio/Mixer.c #, fuzzy @@ -900,7 +898,7 @@ msgstr "Echec de l'init. de la broche MOSI" #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "La valeur max. de x est %d lors d'une opération miroir" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption.\n" @@ -937,7 +935,7 @@ msgstr "Pas de broche TX" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Pas d'horloge disponible" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -958,7 +956,7 @@ msgstr "Pas de support matériel pour cette broche" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Il n'y a plus d'espace libre sur le périphérique" #: py/moduerrno.c msgid "No such file/directory" @@ -1003,7 +1001,7 @@ msgid "" "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d bpp " "given" msgstr "" -"Seul les BMP monochrome, 8bit indexé et 16bit sont supportés: %d bpp fourni" +"Seul les BMP monochromes, 8bit indexé et 16bit sont supportés: %d bpp fourni" #: shared-bindings/_pixelbuf/PixelBuf.c #, fuzzy @@ -1079,7 +1077,7 @@ msgstr "Système de fichier en lecture seule" #: shared-module/displayio/Bitmap.c #, fuzzy msgid "Read-only object" -msgstr "Lecture seule" +msgstr "Objet en lecture seule" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1087,15 +1085,15 @@ msgstr "Canal droit non supporté" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Mode sans-échec. Auto-chargement désactivé.\n" +msgstr "Mode sans-échec! Auto-chargement désactivé.\n" #: main.c msgid "Running in safe mode! Not running saved code.\n" -msgstr "Mode sans-échec! Le code sauvegardé ne s'éxecute pas.\n" +msgstr "Mode sans-échec! Le code sauvegardé n'est pas éxecuté.\n" #: ports/atmel-samd/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1180,7 +1178,7 @@ msgstr "" #: shared-module/audioio/Mixer.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "Le bits_per_sample de l'échantillon ne correspond pas à celui du mixer" +msgstr "Le 'bits_per_sample' de l'échantillon ne correspond pas à celui du mixer" #: shared-module/audioio/Mixer.c msgid "The sample's channel count does not match the mixer's" @@ -1192,19 +1190,19 @@ msgstr "L'échantillonage de l'échantillon ne correspond pas à celui du mixer" #: shared-module/audioio/Mixer.c msgid "The sample's signedness does not match the mixer's" -msgstr "Le signe de l'échantillon ne correspond pas au mixer" +msgstr "Le signe de l'échantillon ne correspond pas à celui du mixer" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "La hauteur de la tuile doit diviser exactement la hauteur de l'image" #: shared-bindings/displayio/TileGrid.c msgid "Tile indices must be 0 - 255" -msgstr "" +msgstr "Les indices des tuiles doivent être compris entre 0 et 255 " #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without " @@ -1216,11 +1214,11 @@ msgstr "Trop de canaux dans l'échantillon." #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/ParallelBus.c msgid "Too many display busses" -msgstr "" +msgstr "Trop de bus d'affichage" #: shared-bindings/displayio/Display.c msgid "Too many displays" -msgstr "" +msgstr "Trop d'affichages" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1244,7 +1242,7 @@ msgstr "valeur de l'entier UUID est hors-bornes 0 à 0xffff" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "la chaîne UUID n'est pas du format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "La chaîne UUID n'est pas au format 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/bleio/UUID.c msgid "UUID value is not str, int or byte buffer" @@ -1266,7 +1264,7 @@ msgstr "Impossible d'initialiser le parser" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "Impossible de lire les données de la palette de couleurs" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -1275,12 +1273,12 @@ msgstr "Impossible d'écrire sur la mémoire non-volatile." #: ports/nrf/common-hal/bleio/UUID.c #, fuzzy msgid "Unexpected nrfx uuid type" -msgstr "Type nrfx uuid inattendu" +msgstr "Type inattendu pour l'uuid nrfx" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "Pas de correspondance du nombres d'éléments de RHS (attendu %d, obtenu %d)" +msgstr "Pas de correspondance du nombres d'éléments à droite (attendu %d, obtenu %d)" #: ports/atmel-samd/common-hal/busio/I2C.c msgid "Unsupported baudrate" @@ -1289,7 +1287,7 @@ msgstr "Débit non supporté" #: shared-module/displayio/Display.c #, fuzzy msgid "Unsupported display bus type" -msgstr "type de bitmap non supporté" +msgstr "Type de bus d'affichage non supporté" #: shared-module/audioio/WaveFile.c msgid "Unsupported format" @@ -1305,7 +1303,7 @@ msgstr "Valeur de tirage 'pull' non supportée." #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" -msgstr "les fonctions Viper ne supportent pas plus de 4 arguments actuellement" +msgstr "les fonctions de Viper ne supportent pas plus de 4 arguments actuellement" #: shared-module/audioio/Mixer.c msgid "Voice index too high" @@ -1326,7 +1324,7 @@ msgid "" msgstr "" "Bienvenue sur Adafruit CircuitPython %s!\n" "\n" -"Vistez learn.adafruit.com/category/circuitpython pour des guides.\n" +"Visitez learn.adafruit.com/category/circuitpython pour les guides.\n" "\n" "Pour lister les modules inclus, tapez `help(\"modules\")`.\n" @@ -1444,7 +1442,7 @@ msgstr "branche hors-bornes" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "buf is too small. need %d bytes" -msgstr "'buf' est trop petit. Besoin de %b octets" +msgstr "'buf' est trop petit. Besoin de %d octets" #: shared-bindings/audioio/RawSample.c msgid "buffer must be a bytes-like object" @@ -1453,7 +1451,7 @@ msgstr "le tampon doit être un objet bytes-like" #: shared-module/struct/__init__.c #, fuzzy msgid "buffer size must match format" -msgstr "les slices de tampon doivent être de longueurs égales" +msgstr "la taille du tampon doit correspondre au format" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" @@ -1470,7 +1468,7 @@ msgstr "les tampons doivent être de la même longueur" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "les boutons doivent être des digitalio.DigitalInOut" #: py/vm.c msgid "byte code not implemented" @@ -1479,7 +1477,7 @@ msgstr "bytecode non implémenté" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "byteorder is not an instance of ByteOrder (got a %s)" -msgstr "" +msgstr "'byteorder' n'est pas une instance de ByteOrder (reçu un %s)" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1519,7 +1517,7 @@ msgstr "impossible d'ajouter une méthode spéciale à une classe déjà sous-cl #: py/compile.c msgid "can't assign to expression" -msgstr "ne peut pas assigner à l'expression" +msgstr "ne peut pas assigner à une expression" #: py/obj.c #, c-format @@ -1529,12 +1527,12 @@ msgstr "ne peut convertir %s en nombre complexe" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "ne peut convertir %s en nombre à virgule flottante (float)" +msgstr "ne peut convertir %s en nombre à virgule flottante 'float'" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "ne peut convertir %s en entier (int)" +msgstr "ne peut convertir %s en entier 'int'" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -1542,16 +1540,16 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" #: py/objint.c msgid "can't convert NaN to int" -msgstr "on ne peut convertir NaN en int" +msgstr "on ne peut convertir NaN en entier 'int'" #: shared-bindings/i2cslave/I2CSlave.c #, fuzzy msgid "can't convert address to int" -msgstr "ne peut convertir %s en entier int" +msgstr "ne peut convertir l'adresse en entier 'int'" #: py/objint.c msgid "can't convert inf to int" -msgstr "on ne peut convertir inf en int" +msgstr "on ne peut convertir l'infini 'inf' en entier 'int'" #: py/obj.c msgid "can't convert to complex" @@ -1559,19 +1557,19 @@ msgstr "ne peut convertir en nombre complexe" #: py/obj.c msgid "can't convert to float" -msgstr "ne peut convertir en nombre à virgule flottante (float)" +msgstr "ne peut convertir en nombre à virgule flottante 'float'" #: py/obj.c msgid "can't convert to int" -msgstr "ne peut convertir en entier (int)" +msgstr "ne peut convertir en entier 'int'" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "impossible de convertir en str implicitement" +msgstr "impossible de convertir en chaine 'str' implicitement" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "ne peut déclarer de nonlocal dans un code externe" +msgstr "ne peut déclarer de 'nonlocal' dans un code externe" #: py/compile.c msgid "can't delete expression" @@ -1603,16 +1601,15 @@ msgstr "impossible de charger depuis '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "impossible de charger avec l'index '%q'" +msgstr "impossible de charger avec l'indice '%q'" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "on ne peut effectuer une action de type 'pend throw' à un générateur fraîchement démarré" +msgstr "on ne peut effectuer une action de type 'pend throw' sur un générateur fraîchement démarré" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" -msgstr "" -"on ne peut envoyer une valeur autre que 'None' à un générateur fraîchement " +msgstr "on ne peut envoyer une valeur autre que 'None' à un générateur fraîchement " "démarré" #: py/objnamedtuple.c @@ -1629,7 +1626,7 @@ msgstr "impossible de stocker vers '%q'" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "impossible de stocker avec un index '%q'" +msgstr "impossible de stocker avec un indice '%q'" #: py/objstr.c msgid "" @@ -1688,13 +1685,12 @@ msgstr "le tampon de couleur doit faire 3 octets (RVB) ou 4 (RVB + pad byte)" #: shared-bindings/displayio/Palette.c #, fuzzy msgid "color buffer must be a buffer or int" -msgstr "le tampon de couleur doit être un tampon ou un entier" +msgstr "le tampon de couleur doit être un tampon ou un entier 'int'" #: shared-bindings/displayio/Palette.c #, fuzzy msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" -"le tampon de couleur doit être un bytearray ou un tableau de type 'b' ou 'B'" +msgstr "le tampon de couleur doit être un bytearray ou un tableau de type 'b' ou 'B'" #: shared-bindings/displayio/Palette.c #, fuzzy @@ -1704,7 +1700,7 @@ msgstr "la couleur doit être entre 0x000000 et 0xffffff" #: shared-bindings/displayio/ColorConverter.c #, fuzzy msgid "color should be an int" -msgstr "la couleur doit être un entier (int)" +msgstr "la couleur doit être un entier 'int'" #: py/objcomplex.c msgid "complex division by zero" @@ -1742,8 +1738,7 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" -"le tampon de destination doit être un tableau de type 'H' pour bit_depth = 16" +msgstr "le tampon de destination doit être un tableau de type 'H' pour bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -1781,7 +1776,7 @@ msgstr "fin de format en cherchant une spécification de conversion" #: shared-bindings/displayio/Shape.c #, fuzzy msgid "end_x should be an int" -msgstr "y doit être un entier (int)" +msgstr "y doit être un entier 'int'" #: ports/nrf/common-hal/busio/UART.c #, c-format @@ -1790,7 +1785,7 @@ msgstr "erreur = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "les exceptions doivent dériver de BaseException" +msgstr "les exceptions doivent dériver de 'BaseException'" #: py/objstr.c msgid "expected ':' after format specifier" @@ -1880,7 +1875,7 @@ msgstr "il manque %d arguments obligatoires à la fonction" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "il manque l'argument nommé obligatoire" +msgstr "il manque un argument nommé obligatoire" #: py/bc.c msgid "function missing required keyword argument '%q'" @@ -1894,7 +1889,7 @@ msgstr "il manque l'argument positionnel obligatoire #%d" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format msgid "function takes %d positional arguments but %d were given" -msgstr "la fonction prend %d argument(s) mais %d ont été donné(s)" +msgstr "la fonction prend %d argument(s) positionnels mais %d ont été donné(s)" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" @@ -1910,7 +1905,7 @@ msgstr "le générateur a ignoré GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "le graphic doit être long de 2048 octets" +msgstr "graphic doit être long de 2048 octets" #: extmod/moduheapq.c msgid "heap must be a list" @@ -1959,7 +1954,7 @@ msgstr "entier requis" #: ports/nrf/common-hal/bleio/Broadcaster.c msgid "interval not in range 0.0020 to 10.24" -msgstr "intervalle hors bornes (0.0020 à 10.24)" +msgstr "intervalle hors bornes 0.0020 à 10.24" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2024,8 +2019,7 @@ msgstr "l'argument 1 de issubclass() doit être une classe" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" -"l'argument 2 de issubclass() doit être une classe ou un tuple de classes" +msgstr "l'argument 2 de issubclass() doit être une classe ou un tuple de classes" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2033,12 +2027,11 @@ msgstr "'join' s'attend à une liste d'objets str/bytes cohérents avec l'objet #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" -msgstr "" -"argument(s) nommé(s) pas encore implémenté - utilisez les arguments normaux" +msgstr "argument(s) nommé(s) pas encore implémenté(s) - utilisez les arguments normaux" #: py/bc.c msgid "keywords must be strings" -msgstr "les noms doivent être des chaînes de caractère" +msgstr "les noms doivent être des chaînes de caractères" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" @@ -2103,11 +2096,11 @@ msgstr "*x multiple dans l'assignement" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "de multiple bases ont un conflit de lay-out d'instance" +msgstr "de multiples bases ont un conflit de lay-out d'instance" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "héritage multiple non supportée" +msgstr "héritages multiples non supportés" #: py/emitnative.c msgid "must raise an object" @@ -2115,7 +2108,7 @@ msgstr "doit lever un objet" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" -msgstr "SCK, MOSI et MISO doivent tous être spécifiés" +msgstr "sck, mosi et miso doivent tous être spécifiés" #: py/modbuiltins.c msgid "must use keyword argument for key function" @@ -2145,11 +2138,11 @@ msgstr "" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "nécessite plus de %d valeur à dégrouper" +msgstr "nécessite plus de %d valeurs à dégrouper" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "puissance négative sans support des nombres à virgules flottantes" +msgstr "puissance négative sans support des nombres à virgule flottante" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" @@ -2178,8 +2171,7 @@ msgstr "pas de tel attribut" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" -"un argument sans valeur par défaut suit un argument avec valeur par défaut" +msgstr "un argument sans valeur par défaut suit un argument avec valeur par défaut" #: extmod/modubinascii.c msgid "non-hex digit found" @@ -2199,8 +2191,7 @@ msgstr "n'est pas un UUID 128 bits" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" -"tous les arguments n'ont pas été convertis pendant le formatage de la chaîne" +msgstr "tous les arguments n'ont pas été convertis pendant le formatage de la chaîne" #: py/objstr.c msgid "not enough arguments for format string" @@ -2221,7 +2212,7 @@ msgstr "l'objet ne supporte pas la suppression d'éléments" #: py/obj.c msgid "object has no len" -msgstr "l'objet n'a pas de len" +msgstr "l'objet n'a pas de 'len'" #: py/obj.c msgid "object is not subscriptable" @@ -2286,7 +2277,7 @@ msgstr "la palette doit être longue de 32 octets" #: shared-bindings/displayio/Palette.c #, fuzzy msgid "palette_index should be an int" -msgstr "palette_index devrait être un entier (int)'" +msgstr "palette_index devrait être un entier 'int'" #: py/compile.c msgid "parameter annotation must be an identifier" @@ -2304,16 +2295,15 @@ msgstr "les paramètres doivent être des registres dans la séquence r0 à r3" #: shared-bindings/displayio/Bitmap.c #, fuzzy msgid "pixel coordinates out of bounds" -msgstr "adresse hors limites" +msgstr "coordonnées de pixel hors limites" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "la valeur du pixel requiet trop de bits" #: shared-bindings/displayio/TileGrid.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" -"pixel_shader doit être un objet displayio.Palette ou displayio.ColorConverter" +msgstr "pixel_shader doit être un objet displayio.Palette ou displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -2322,11 +2312,11 @@ msgstr "'pop' d'une entrée PulseIn vide" #: py/objset.c msgid "pop from an empty set" -msgstr "pop d'un ensemble set vide" +msgstr "'pop' d'un ensemble set vide" #: py/objlist.c msgid "pop from empty list" -msgstr "pop d'une liste vide" +msgstr "'pop' d'une liste vide" #: py/objdict.c msgid "popitem(): dictionary is empty" @@ -2346,12 +2336,12 @@ msgstr "dépassement de file" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" -msgstr "" +msgstr "'rawbuf' n'est pas de la même taille que 'buf'" #: shared-bindings/_pixelbuf/__init__.c #, fuzzy msgid "readonly attribute" -msgstr "attribut illisible" +msgstr "attribut en lecture seule" #: py/builtinimport.c msgid "relative import" @@ -2433,7 +2423,7 @@ msgstr "indices de début/fin" #: shared-bindings/displayio/Shape.c #, fuzzy msgid "start_x should be an int" -msgstr "y doit être un entier (int)" +msgstr "'start_x' doit être un entier 'int'" #: shared-bindings/random/__init__.c msgid "step must be non-zero" @@ -2458,12 +2448,11 @@ msgstr "index de chaîne hors gamme" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "les indices de chaîne de caractère doivent être des entiers, pas %s" +msgstr "les indices de chaîne de caractères doivent être des entiers, pas %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" -"chaîne de carac. non supportée; utilisez des bytes ou un tableau de bytes" +msgstr "chaîne de carac. non supportée; utilisez des bytes ou un tableau de bytes" #: extmod/moductypes.c msgid "struct: cannot index" @@ -2471,7 +2460,7 @@ msgstr "struct: indexage impossible" #: extmod/moductypes.c msgid "struct: index out of range" -msgstr "struct: index hors limite" +msgstr "struct: index hors limites" #: extmod/moductypes.c msgid "struct: no fields" @@ -2499,7 +2488,7 @@ msgstr "le seuil doit être dans la gamme 0-65536" #: shared-bindings/displayio/TileGrid.c msgid "tile index out of bounds" -msgstr "" +msgstr "indice de tuile hors limites" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" @@ -2545,7 +2534,7 @@ msgstr "tuple/liste a une mauvaise longueur" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "tuple ou liste requis en partie droite" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "tx and rx cannot both be None" @@ -2593,7 +2582,7 @@ msgstr "échappements de nom unicode" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "la désindentation ne correspond à aucune indentation" +msgstr "la désindentation ne correspond à aucune indentation précédente" #: py/objstr.c #, c-format @@ -2665,11 +2654,11 @@ msgstr "type non supporté pour %q: '%s', '%s'" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "'value_count' doit être > 0" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" -msgstr "" +msgstr "'write_args' doit être une liste, un tuple ou 'None'" #: py/objstr.c msgid "wrong number of arguments" @@ -2682,17 +2671,17 @@ msgstr "mauvais nombre de valeurs à dégrouper" #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" -msgstr "adresse hors limites" +msgstr "valeur x hors limites" #: shared-bindings/displayio/Shape.c #, fuzzy msgid "y should be an int" -msgstr "y doit être un entier (int)" +msgstr "y doit être un entier 'int'" #: shared-module/displayio/Shape.c #, fuzzy msgid "y value out of bounds" -msgstr "adresse hors limites" +msgstr "valeur y hors limites" #: py/objrange.c msgid "zero step" -- cgit v1.2.3 From c57e07789de9cc65db86fa21de8ddde90a767d59 Mon Sep 17 00:00:00 2001 From: Pierrick C Date: Sun, 14 Apr 2019 23:11:05 +0200 Subject: Missing '\n' --- locale/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index 1ada5941f..3f8b1c0bb 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -902,7 +902,7 @@ msgstr "La valeur max. de x est %d lors d'une opération miroir" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible." +msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible.\n" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error.\n" -- cgit v1.2.3 From 5135ee52d9dfbb630d81a4a35cc9498cfd42708c Mon Sep 17 00:00:00 2001 From: siddacious Date: Sun, 14 Apr 2019 19:45:44 -0700 Subject: Changing to support for CP32-M4 wrover --- ports/atmel-samd/boards/cp32-m4/mpconfigboard.h | 12 ++--- ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk | 4 +- ports/atmel-samd/boards/cp32-m4/pins.c | 60 ++++++++++++++---------- 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h index 5587d165a..9e329b3ed 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h @@ -1,13 +1,13 @@ #define MICROPY_HW_BOARD_NAME "CP32-M4" -#define MICROPY_HW_MCU_NAME "samd51g19" +#define MICROPY_HW_MCU_NAME "samd51j20" -#define MICROPY_HW_APA102_MOSI (&pin_PA17) -#define MICROPY_HW_APA102_SCK (&pin_PA16) +#define MICROPY_HW_APA102_MOSI (&pin_PA12) +#define MICROPY_HW_APA102_SCK (&pin_PA13) #define CIRCUITPY_MCU_FAMILY samd51 -#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11| PORT_PA16| PORT_PA17) +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11| PORT_PA12| PORT_PA13) #define MICROPY_PORT_B ( PORT_PB10 | PORT_PB11) #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) @@ -27,5 +27,5 @@ #define DEFAULT_SPI_BUS_MOSI (&pin_PA23) #define DEFAULT_SPI_BUS_MISO (&pin_PA21) -#define DEFAULT_UART_BUS_RX (&pin_PA12) -#define DEFAULT_UART_BUS_TX (&pin_PA13) +#define DEFAULT_UART_BUS_RX (&pin_PB17) +#define DEFAULT_UART_BUS_TX (&pin_PB16) diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index 0fba81ac0..0444a37b9 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -1,4 +1,4 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld +LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "CP32-M4" @@ -13,5 +13,5 @@ CIRCUITPY_AUDIOBUSIO = 0 # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 -CHIP_VARIANT = SAMD51G19A +CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/cp32-m4/pins.c b/ports/atmel-samd/boards/cp32-m4/pins.c index bbad6f75f..1946c9d3a 100644 --- a/ports/atmel-samd/boards/cp32-m4/pins.c +++ b/ports/atmel-samd/boards/cp32-m4/pins.c @@ -5,32 +5,44 @@ // microcontroller.pin. STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_P), MP_ROM_PTR(&pin_PA02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SW3_4), MP_ROM_PTR(&pin_PB09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SW1_2), MP_ROM_PTR(&pin_PA04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_N), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_BACKLIGHT_PWM), MP_ROM_PTR(&pin_PB09) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SW1_2), MP_ROM_PTR(&pin_PA06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SW3_4), MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SW5), MP_ROM_PTR(&pin_PB12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SW7), MP_ROM_PTR(&pin_PB06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SW8), MP_ROM_PTR(&pin_PB03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SW9), MP_ROM_PTR(&pin_PB05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SW10), MP_ROM_PTR(&pin_PB04) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR3), MP_ROM_PTR(&pin_PB07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR4), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR5), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_SW6), MP_ROM_PTR(&pin_PA21) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SD0), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD1), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD2), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD3), MP_ROM_PTR(&pin_PB14) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MOSI), MP_ROM_PTR(&pin_PB23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MISO), MP_ROM_PTR(&pin_PB22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS0), MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS1), MP_ROM_PTR(&pin_PA27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_PA23) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SW9), MP_ROM_PTR(&pin_PA06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SW7), MP_ROM_PTR(&pin_PA07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_BACKLIGHT_PWM), MP_ROM_PTR(&pin_PA12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR3), MP_ROM_PTR(&pin_PA13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SW5), MP_ROM_PTR(&pin_PA14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR4), MP_ROM_PTR(&pin_PA15) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PA16) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA17) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED), MP_ROM_PTR(&pin_PA18) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SW6), MP_ROM_PTR(&pin_PA19) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS0), MP_ROM_PTR(&pin_PA20) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MISO), MP_ROM_PTR(&pin_PA21) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_SCK), MP_ROM_PTR(&pin_PA22) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_MOSI), MP_ROM_PTR(&pin_PA23) }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_VSPI_CS1), MP_ROM_PTR(&pin_PB22) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_EXT_HDR5), MP_ROM_PTR(&pin_PB23) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_PA27) }, - { MP_ROM_QSTR(MP_QSTR_SW8), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_SW10), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, -- cgit v1.2.3 From ade6bd8185b2014eab3b376414951b77312cadeb Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 15 Apr 2019 14:38:02 +0200 Subject: Enable _stage module and freeze stage library on the PyBadge --- frozen/circuitpython-stage | 2 +- ports/atmel-samd/boards/pybadge/mpconfigboard.mk | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 069fad835..5669083c2 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 069fad8357623f5ea2ff3c865a5b8ed54608afd7 +Subproject commit 5669083c2d2cada8b2a1108cdcd4c69694648c93 diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 8828c17b2..837e2e514 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -16,3 +16,10 @@ CIRCUITPY_TOUCHIO = 0 CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 + +CIRCUITPY_STAGE = 1 +CIRCUITPY_GAMEPAD = 1 +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_AUDIOIO = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge -- cgit v1.2.3 From 2023c8329f39c11bec587188fcab890b6c02e30d Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 15 Apr 2019 21:06:30 +0200 Subject: Enable builds for ugame10 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2a3ece6fd..48c86a9f9 100755 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ env: - TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini" TRAVIS_SDK=arm:nrf - TRAVIS_BOARDS="metro_m0_express metro_m4_express metro_m4_airlift_lite pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo bast_pro_mini_m0" TRAVIS_SDK=arm - TRAVIS_BOARDS="feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip" TRAVIS_SDK=arm - - TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite" TRAVIS_SDK=arm + - TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10" TRAVIS_SDK=arm - TRAVIS_BOARDS="circuitplayground_express_crickit feather_m0_adalogger feather_m0_basic feather_m0_express catwan_usbstick pyportal sparkfun_samd21_mini sparkfun_samd21_dev pybadge" TRAVIS_SDK=arm addons: -- cgit v1.2.3 From 254d0a53acf4bb30013116ae29b927a04b4f99e9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 15 Apr 2019 18:50:33 -0700 Subject: Revert "nrf nvm: touchups to nickzoic PR #1768" --- ports/nrf/Makefile | 1 - ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 1 + .../feather_nrf52840_express/mpconfigboard.h | 5 +- ports/nrf/common-hal/microcontroller/__init__.c | 15 ---- ports/nrf/common-hal/nvm/ByteArray.c | 77 ------------------ ports/nrf/common-hal/nvm/ByteArray.h | 38 --------- ports/nrf/common-hal/nvm/__init__.c | 27 ------ ports/nrf/mpconfigport.mk | 4 +- ports/nrf/peripherals/nrf/nvm.c | 95 ---------------------- ports/nrf/peripherals/nrf/nvm.h | 34 -------- ports/nrf/supervisor/internal_flash.c | 86 ++++++++++++++++---- ports/nrf/supervisor/internal_flash.h | 3 + 12 files changed, 78 insertions(+), 308 deletions(-) delete mode 100644 ports/nrf/common-hal/nvm/ByteArray.c delete mode 100644 ports/nrf/common-hal/nvm/ByteArray.h delete mode 100644 ports/nrf/common-hal/nvm/__init__.c delete mode 100644 ports/nrf/peripherals/nrf/nvm.c delete mode 100644 ports/nrf/peripherals/nrf/nvm.h diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index b32b25217..3cb4b52aa 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -177,7 +177,6 @@ SRC_C += \ peripherals/nrf/clocks.c \ peripherals/nrf/$(MCU_CHIP)/pins.c \ peripherals/nrf/$(MCU_CHIP)/power.c \ - peripherals/nrf/nvm.c \ peripherals/nrf/timers.c \ sd_mutex.c \ supervisor/shared/memory.c diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 2587a19e3..8a700d610 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -11,6 +11,7 @@ 0x000ED000..0x000F3FFF (28KB ) Private Config Data (Bonding, Keys, etc.) 0x000AD000..0x000ECFFF (256KB) User Filesystem + 0x00026000..0x000ACFFF (540KB) Application Code (including ISR vector) 0x00001000..0x00025FFF (148KB) SoftDevice 0x00000000..0x00000FFF (4KB) Master Boot Record diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index e1f43e3c9..eb8be7608 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -33,9 +33,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "Feather52840Express" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_NEOPIXEL (&pin_P0_16) #define MICROPY_HW_LED_STATUS (&pin_P1_15) @@ -58,7 +55,7 @@ #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) +// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 92aac772a..c2e0c5b41 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -24,14 +24,9 @@ * THE SOFTWARE. */ -#include "py/mphal.h" -#include "py/obj.h" -#include "py/runtime.h" - #include "common-hal/microcontroller/Pin.h" #include "common-hal/microcontroller/Processor.h" -#include "shared-bindings/nvm/ByteArray.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" @@ -68,16 +63,6 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; -#if CIRCUITPY_INTERNAL_NVM_SIZE > 0 -// The singleton nvm.ByteArray object. -const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { - .base = { - .type = &nvm_bytearray_type, - }, - .len = CIRCUITPY_INTERNAL_NVM_SIZE, - .start_address = (uint8_t*) (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE), -}; -#endif STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_00), MP_ROM_PTR(&pin_P0_00) }, diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c deleted file mode 100644 index 4373e2502..000000000 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Nick Moore for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "common-hal/nvm/ByteArray.h" - -#include -#include - -#include "peripherals/nrf/nvm.h" - -// defined in linker -extern uint32_t __fatfs_flash_start_addr[]; -extern uint32_t __fatfs_flash_length[]; - -uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { - return self->len; -} - -static void write_page(uint8_t* page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { - // Write a whole page to flash, buffering it first and then erasing and rewriting - // it since we can only clear a whole page at a time. - - if (offset == 0 && len == FLASH_PAGE_SIZE) { - nrf_nvm_safe_flash_page_write((uint32_t) page_addr, bytes); - } else { - uint8_t buffer[FLASH_PAGE_SIZE]; - memcpy(buffer, page_addr, FLASH_PAGE_SIZE); - memcpy(buffer + offset, bytes, len); - nrf_nvm_safe_flash_page_write((uint32_t) page_addr, buffer); - } -} - -bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, - uint32_t start_index, uint8_t* values, uint32_t len) { - - uint32_t address = ((uint32_t) self->start_address) + start_index; - uint32_t offset = address % FLASH_PAGE_SIZE; - uint32_t page_addr = address - offset; - - while (len) { - uint32_t write_len = MIN(len, FLASH_PAGE_SIZE - offset); - write_page((uint8_t*) page_addr, offset, write_len, values); - len -= write_len; - values += write_len; - page_addr += FLASH_PAGE_SIZE; - offset = 0; - } - return true; -} - -void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, - uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, self->start_address + start_index, len); -} diff --git a/ports/nrf/common-hal/nvm/ByteArray.h b/ports/nrf/common-hal/nvm/ByteArray.h deleted file mode 100644 index c048d5577..000000000 --- a/ports/nrf/common-hal/nvm/ByteArray.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Nick Moore for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - uint8_t* start_address; - uint32_t len; -} nvm_bytearray_obj_t; - -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/nrf/common-hal/nvm/__init__.c b/ports/nrf/common-hal/nvm/__init__.c deleted file mode 100644 index 3cdc9d3a4..000000000 --- a/ports/nrf/common-hal/nvm/__init__.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Nick Moore for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -// No nvm module functions. diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 83166708a..fdeb1bbbe 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -19,8 +19,8 @@ CIRCUITPY_AUDIOBUSIO = 0 # No I2CSlave implementation CIRCUITPY_I2CSLAVE = 0 -# enable NVM -CIRCUITPY_NVM = 1 +# nvm not yet implemented +CIRCUITPY_NVM = 0 # enable RTC CIRCUITPY_RTC = 1 diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c deleted file mode 100644 index d8fddc4dc..000000000 --- a/ports/nrf/peripherals/nrf/nvm.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019 Nick Moore for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/runtime.h" - -#include -#include - -#include "nrf_nvmc.h" - -#define FLASH_PAGE_SIZE (4096) - -#ifdef BLUETOOTH_SD -#include "ble_drv.h" -#include "nrf_sdm.h" - -STATIC void sd_flash_operation_start(void) { - sd_flash_operation_status = SD_FLASH_OPERATION_IN_PROGRESS; -} - -STATIC sd_flash_operation_status_t sd_flash_operation_wait_until_done(void) { - while (sd_flash_operation_status == SD_FLASH_OPERATION_IN_PROGRESS) { - sd_app_evt_wait(); - } - return sd_flash_operation_status; -} -#endif - -void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { - #ifdef BLUETOOTH_SD - uint8_t sd_en = 0; - (void) sd_softdevice_is_enabled(&sd_en); - if (sd_en) { - uint32_t err_code; - sd_flash_operation_status_t status; - - sd_flash_operation_start(); - err_code = sd_flash_page_erase(page_addr / FLASH_PAGE_SIZE); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash erase failed to start, err 0x%04x"), err_code); - } - status = sd_flash_operation_wait_until_done(); - if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash erase failed")); - } - - // Divide a full page into parts, because writing a full page causes an assertion failure. - // See https://devzone.nordicsemi.com/f/nordic-q-a/40088/sd_flash_write-cause-nrf_fault_id_sd_assert/ - const size_t BLOCK_PARTS = 2; - size_t words_to_write = FLASH_PAGE_SIZE / sizeof(uint32_t) / BLOCK_PARTS; - for (size_t i = 0; i < BLOCK_PARTS; i++) { - sd_flash_operation_start(); - err_code = sd_flash_write(((uint32_t *)page_addr) + i * words_to_write, - (uint32_t *)data + i * words_to_write, - words_to_write); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash write failed to start, err 0x%04x"), err_code); - } - status = sd_flash_operation_wait_until_done(); - if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash write failed")); - } - } - - return; - } - #endif - - nrf_nvmc_page_erase(page_addr); - nrf_nvmc_write_bytes(page_addr, data, FLASH_PAGE_SIZE); -} diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h deleted file mode 100644 index 4eac3d728..000000000 --- a/ports/nrf/peripherals/nrf/nvm.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019 Nick Moore for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define FLASH_PAGE_SIZE (4096) - -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (0) -#endif - -void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index 5713dea88..c18b708a3 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" -#include "peripherals/nrf/nvm.h" +#include "nrf_nvmc.h" #ifdef BLUETOOTH_SD #include "ble_drv.h" @@ -47,8 +47,9 @@ extern uint32_t __fatfs_flash_start_addr[]; extern uint32_t __fatfs_flash_length[]; #define NO_CACHE 0xffffffff +#define FL_PAGE_SZ 4096 -uint8_t _flash_cache[FLASH_PAGE_SIZE] __attribute__((aligned(4))); +uint8_t _flash_cache[FL_PAGE_SZ] __attribute__((aligned(4))); uint32_t _flash_page_addr = NO_CACHE; @@ -67,22 +68,81 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; + return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; } +#ifdef BLUETOOTH_SD +STATIC void sd_flash_operation_start(void) { + sd_flash_operation_status = SD_FLASH_OPERATION_IN_PROGRESS; +} + +STATIC sd_flash_operation_status_t sd_flash_operation_wait_until_done(void) { + while (sd_flash_operation_status == SD_FLASH_OPERATION_IN_PROGRESS) { + sd_app_evt_wait(); + } + return sd_flash_operation_status; +} +#endif + void supervisor_flash_flush(void) { if (_flash_page_addr == NO_CACHE) return; // Skip if data is the same - if (memcmp(_flash_cache, (void *)_flash_page_addr, FLASH_PAGE_SIZE) != 0) { - nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); + if (memcmp(_flash_cache, (void *)_flash_page_addr, FL_PAGE_SZ) != 0) { + +#ifdef BLUETOOTH_SD + uint8_t sd_en = 0; + (void) sd_softdevice_is_enabled(&sd_en); + + if (sd_en) { + uint32_t err_code; + sd_flash_operation_status_t status; + + sd_flash_operation_start(); + err_code = sd_flash_page_erase(_flash_page_addr / FL_PAGE_SZ); + if (err_code != NRF_SUCCESS) { + mp_raise_OSError_msg_varg(translate("Flash erase failed to start, err 0x%04x"), err_code); + } + status = sd_flash_operation_wait_until_done(); + if (status == SD_FLASH_OPERATION_ERROR) { + mp_raise_OSError_msg(translate("Flash erase failed")); + } + + // Divide a full page into parts, because writing a full page causes an assertion failure. + // See https://devzone.nordicsemi.com/f/nordic-q-a/40088/sd_flash_write-cause-nrf_fault_id_sd_assert/ + const size_t BLOCK_PARTS = 2; + size_t words_to_write = FL_PAGE_SZ / sizeof(uint32_t) / BLOCK_PARTS; + for (size_t i = 0; i < BLOCK_PARTS; i++) { + sd_flash_operation_start(); + err_code = sd_flash_write(((uint32_t *)_flash_page_addr) + i * words_to_write, + (uint32_t *)_flash_cache + i * words_to_write, + words_to_write); + if (err_code != NRF_SUCCESS) { + mp_raise_OSError_msg_varg(translate("Flash write failed to start, err 0x%04x"), err_code); + } + status = sd_flash_operation_wait_until_done(); + if (status == SD_FLASH_OPERATION_ERROR) { + mp_raise_OSError_msg(translate("Flash write failed")); + } + } + } else { +#endif + nrf_nvmc_page_erase(_flash_page_addr); + nrf_nvmc_write_words(_flash_page_addr, (uint32_t *)_flash_cache, FL_PAGE_SZ / sizeof(uint32_t)); +#ifdef BLUETOOTH_SD + } +#endif + } + _flash_page_addr = NO_CACHE; +} + +void supervisor_flash_release_cache(void) { } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { // Must write out anything in cache before trying to read. supervisor_flash_flush(); - uint32_t src = lba2addr(block); memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); return 0; // success @@ -91,21 +151,21 @@ mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t n mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32_t num_blocks) { while (num_blocks) { uint32_t const addr = lba2addr(lba); - uint32_t const page_addr = addr & ~(FLASH_PAGE_SIZE - 1); + uint32_t const page_addr = addr & ~(FL_PAGE_SZ - 1); uint32_t count = 8 - (lba % 8); // up to page boundary count = MIN(num_blocks, count); if (page_addr != _flash_page_addr) { - nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); - _flash_page_addr = page_addr; + supervisor_flash_flush(); + _flash_page_addr = page_addr; // Copy the current contents of the entire page into the cache. - memcpy(_flash_cache, (void *)page_addr, FLASH_PAGE_SIZE); + memcpy(_flash_cache, (void *)page_addr, FL_PAGE_SZ); } // Overwrite part or all of the page cache with the src data. - memcpy(_flash_cache + (addr & (FLASH_PAGE_SIZE - 1)), src, count * FILESYSTEM_BLOCK_SIZE); + memcpy(_flash_cache + (addr & (FL_PAGE_SZ - 1)), src, count * FILESYSTEM_BLOCK_SIZE); // adjust for next run lba += count; @@ -115,7 +175,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 return 0; // success } - -void supervisor_flash_release_cache(void) { -} - diff --git a/ports/nrf/supervisor/internal_flash.h b/ports/nrf/supervisor/internal_flash.h index 024a53ebb..cf1dc91b5 100644 --- a/ports/nrf/supervisor/internal_flash.h +++ b/ports/nrf/supervisor/internal_flash.h @@ -31,6 +31,9 @@ #include "py/mpconfig.h" +#define FLASH_PAGE_SIZE 0x1000 +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -- cgit v1.2.3 From 32a0855d18c194a926c137018ea42ccff6adc44f Mon Sep 17 00:00:00 2001 From: Tavish Naruka Date: Tue, 16 Apr 2019 03:15:28 +0530 Subject: Add support for Electronut Labs Papyr. Signed-off-by: Tavish Naruka --- ports/nrf/README.md | 1 + ports/nrf/boards/electronut_labs_papyr/README.md | 58 ++++++++++++++++++++++ ports/nrf/boards/electronut_labs_papyr/board.c | 38 ++++++++++++++ .../boards/electronut_labs_papyr/mpconfigboard.h | 52 +++++++++++++++++++ .../boards/electronut_labs_papyr/mpconfigboard.mk | 22 ++++++++ ports/nrf/boards/electronut_labs_papyr/pins.c | 44 ++++++++++++++++ 6 files changed, 215 insertions(+) create mode 100644 ports/nrf/boards/electronut_labs_papyr/README.md create mode 100644 ports/nrf/boards/electronut_labs_papyr/board.c create mode 100644 ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h create mode 100644 ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk create mode 100644 ports/nrf/boards/electronut_labs_papyr/pins.c diff --git a/ports/nrf/README.md b/ports/nrf/README.md index 49c9fbe29..65a66b7b0 100644 --- a/ports/nrf/README.md +++ b/ports/nrf/README.md @@ -78,6 +78,7 @@ pca10056 | s140 | Peripheral and Scanner | [S feather_nrf52840_express | s140 | Peripheral and Scanner | UF2 bootloader makerdiary_nrf52840_mdk | s140 | Peripheral and Scanner | pyocd or ARM mbed DAPLink makerdiary_nrf52840_mdk_usb_dongle | s140 | Peripheral and Scanner | DFU bootloader & nrfutil +electronut_labs_papyr | s140 | Peripheral and Scanner | UF2 bootloader ## Segger Targets diff --git a/ports/nrf/boards/electronut_labs_papyr/README.md b/ports/nrf/boards/electronut_labs_papyr/README.md new file mode 100644 index 000000000..fda390193 --- /dev/null +++ b/ports/nrf/boards/electronut_labs_papyr/README.md @@ -0,0 +1,58 @@ +# Setup + +The `Electronut Labs Papyr` board is based on the `nRF52840` SoC from +Nordic Semiconductors. It has an e-ink display on it, along with a CR2477 +battery holder. + +Papyr can be programmed with the [`Adafruit nRF52 bootloader`](https://github.com/adafruit/Adafruit_nRF52_Bootloader) to + +Schematic, datasheet default pin mapping etc. can be found over [here](https://docs.electronut.in/papyr/). The default pin mapping can be found in the board directory. + +## Installing CircuitPython submodules + +Before you can build, you will need to run the following commands once, which +will install the submodules that are part of the CircuitPython ecosystem, and +build the `mpy-cross` tool: + +``` +$ cd circuitpython +$ git submodule update --init +$ make -C mpy-cross +``` + +## Installing the Bootloader + +If the `Adafruit nRF52 bootloader` is installed on the board, then the +bootloader allows you to update the core CircuitPython firmware and internal +file system contents using serial, or USB CDC, or USB mass storage. + +On empty devices, the bootloader will need to be flashed once using a +HW debugger such as a Segger J-Link, or Blackmagicprobe +(or [Electronut labs Bumpy](https://docs.electronut.in/bumpy/)). + + +## Building and Flashing CircuitPython + +No special notes for this, follow `ports/nrf` generic `README.md`. + +### Flashing CircuitPython with MSC UF2 + +`uf2` file is generated last by `all` target. + +``` +$ cd ports/nrf +$ make V=1 SD=s140 SERIAL=/dev/ttyACM0 BOARD=electronut_labs_papyr all +... +... +python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-electronut_labs_papyr-s140/firmware.uf2" build-electronut_labs_papyr-s140/firmware.hex +Converting to uf2, output size: 536576, start address: 0x26000 +Wrote 536576 bytes to build-electronut_labs_papyr-s140/firmware.uf2 +``` + +Simply drag and drop firmware.uf2 to the MSC, the nrf52840 will blink fast and reset after done. + +### Other tips + +Once circuitpython is running on your board, it will come up as a mass storage +device named `CIRCUITPY`, where you can drop in your python code. The file names +it looks for are `main.py`, `main.txt`, `code.py` or `code.txt`. diff --git a/ports/nrf/boards/electronut_labs_papyr/board.c b/ports/nrf/boards/electronut_labs_papyr/board.c new file mode 100644 index 000000000..4421970ee --- /dev/null +++ b/ports/nrf/boards/electronut_labs_papyr/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h new file mode 100644 index 000000000..7f5021fdc --- /dev/null +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define ELECTRONUT_LABS_PAPYR + +#define MICROPY_HW_BOARD_NAME "Electronut Labs Papyr" +#define MICROPY_HW_MCU_NAME "nRF52840" +#define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" + +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + +// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_06) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_05) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_31) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_29) +#define DEFAULT_SPI_BUS_MISO (&pin_P1_01) + +#define DEFAULT_UART_BUS_RX (&pin_P0_07) +#define DEFAULT_UART_BUS_TX (&pin_P0_08) diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk new file mode 100644 index 000000000..5aee244f1 --- /dev/null +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk @@ -0,0 +1,22 @@ +USB_VID = 0x239A +USB_PID = 0x803C +USB_PRODUCT = "Papyr" +USB_MANUFACTURER = "Electronut Labs" + +MCU_SERIES = m4 +MCU_VARIANT = nrf52 +MCU_SUB_VARIANT = nrf52840 +MCU_CHIP = nrf52840 +SD ?= s140 +SOFTDEV_VERSION ?= 6.1.0 + +BOOT_SETTING_ADDR = 0xFF000 + +ifeq ($(SD),) + LD_FILE = boards/nrf52840_1M_256k.ld +else + LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld + CIRCUITPY_BLEIO = 1 +endif + +NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 \ No newline at end of file diff --git a/ports/nrf/boards/electronut_labs_papyr/pins.c b/ports/nrf/boards/electronut_labs_papyr/pins.c new file mode 100644 index 000000000..ef0178e9b --- /dev/null +++ b/ports/nrf/boards/electronut_labs_papyr/pins.c @@ -0,0 +1,44 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_BUSY), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_DC), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_RES), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_EINK_EN), MP_ROM_PTR(&pin_P0_11) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_07) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_05) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P0_14) }, + + { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_P0_13) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); -- cgit v1.2.3