[GitHub] mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash
mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash URL: https://github.com/apache/mynewt-core/pull/1015#discussion_r182450462 ## File path: hw/mcu/nordic/nrf52xxx/syscfg.yml ## @@ -114,6 +114,76 @@ syscfg.defs: description: 'SOFT PWM' value: 0 +QSPI_ENABLE: +descritption: 'NRF52 QSPI' +value: 0 + +QSPI_READOC: +descritption: > Review comment: Typo: descritption should be description. Alos see QSPI_WRITEOC This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] michal-narajowski opened a new pull request #161: cmake: Use paths relative to project root
michal-narajowski opened a new pull request #161: cmake: Use paths relative to project root URL: https://github.com/apache/mynewt-newt/pull/161 Absolute paths shouldnt be necessary, CMake takes care of paths. Some users had issues with using absolute paths. This makes the CMakeLists.txt file smaller. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash
mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash URL: https://github.com/apache/mynewt-core/pull/1015#discussion_r182450775 ## File path: hw/mcu/nordic/nrf52xxx/syscfg.yml ## @@ -114,6 +114,76 @@ syscfg.defs: description: 'SOFT PWM' value: 0 +QSPI_ENABLE: +descritption: 'NRF52 QSPI' +value: 0 + +QSPI_READOC: +descritption: > +QSPI Command to use +0 - 0x09 Fast Read +1 - 0x3B Fast Read Dual Output +2 - 0xBB Fast Read Dual I/O +3 - 0x6B Fast Read Quad Output +4 - 0xEB Fast Read Quad I/O +value: 0 +QSPI_WRITEOC: +descritption: > +QSPI Command to use +0 - 0x02 Page program +1 - 0xA2 Page program Dual Data +2 - 0x32 Page program Quad Data +3 - 0x38 Page program Quad I/O +value: 0 +QSPI_ADDRMODE: +description: 'Address lentgh 0=24 bits, 1=32 bits' +value: 0 +QSPI_DPMCONFIG: +description: 'Deep power mode enable' +value: 0 +QSPI_SCK_DELAY: +description: > +Minimum amount of time that the CSN pin must stay high +before it can go low again. Value is specified in number of 16 +MHz periods (62.5 ns). +value: 0 +QSPI_SCK_FREQ: +description: '32MHz clock divider (0-31). Clock = 32MHz / (1+divider)' +value: 0 +QSPI_SPI_MODE: +description: 'SPI 0=Mode0 or 1=Mode3' +value: 0 + +QSPI_FLASH_SECTOR_SIZE: +description: 'QSPI sector size' +value: 4096 Review comment: Set default value to 0. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash
mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash URL: https://github.com/apache/mynewt-core/pull/1015#discussion_r182449940 ## File path: hw/mcu/nordic/nrf52xxx/src/hal_qspi.c ## @@ -0,0 +1,279 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include "os/mynewt.h" +#if MYNEWT_VAL(QSPI_ENABLE) +#include +#include +#include "mcu/nrf52_hal.h" +#include "nrf.h" +#include + +#if MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT) < 1 +#error QSPI_FLASH_SECTOR_COUNT must be set to the correct value in bsp.yml +#endif + +#if MYNEWT_VAL(QSPI_PIN_CS) < 0 +#error QSPI_PIN_CS must be set to the correct value in bsp.yml +#endif + +#if MYNEWT_VAL(QSPI_PIN_SCK) < 0 +#error QSPI_PIN_SCK must be set to the correct value in bsp.yml +#endif + +#if MYNEWT_VAL(QSPI_PIN_DIO0) < 0 +#error QSPI_PIN_DIO0 must be set to the correct value in bsp.yml +#endif + +#if MYNEWT_VAL(QSPI_PIN_DIO1) < 0 +#error QSPI_PIN_DIO1 must be set to the correct value in bsp.yml +#endif + +#if MYNEWT_VAL(QSPI_PIN_DIO2) < 0 && (MYNEWT_VAL(QSPI_READOC) > 2 || MYNEWT_VAL(QSPI_WRITEOC) > 1) +#error QSPI_PIN_DIO2 must be set to the correct value in bsp.yml +#endif + +#if MYNEWT_VAL(QSPI_PIN_DIO3) < 0 && (MYNEWT_VAL(QSPI_READOC) > 2 || MYNEWT_VAL(QSPI_WRITEOC) > 1) +#error QSPI_PIN_DIO3 must be set to the correct value in bsp.yml +#endif + +static int +nrf52k_qspi_read(const struct hal_flash *dev, uint32_t address, +void *dst, uint32_t num_bytes); +static int +nrf52k_qspi_write(const struct hal_flash *dev, uint32_t address, +const void *src, uint32_t num_bytes); +static int +nrf52k_qspi_erase_sector(const struct hal_flash *dev, +uint32_t sector_address); +static int +nrf52k_qspi_sector_info(const struct hal_flash *dev, int idx, +uint32_t *address, uint32_t *sz); +static int +nrf52k_qspi_init(const struct hal_flash *dev); + +static const struct hal_flash_funcs nrf52k_qspi_funcs = { +.hff_read = nrf52k_qspi_read, +.hff_write = nrf52k_qspi_write, +.hff_erase_sector = nrf52k_qspi_erase_sector, +.hff_sector_info = nrf52k_qspi_sector_info, +.hff_init = nrf52k_qspi_init +}; + +const struct hal_flash nrf52k_qspi_dev = { +.hf_itf = _qspi_funcs, +.hf_base_addr = 0x, +.hf_size = MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT) * MYNEWT_VAL(QSPI_FLASH_SECTOR_SIZE), +.hf_sector_cnt = MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT), +.hf_align = 1 +}; + +static int +nrf52k_qspi_read(const struct hal_flash *dev, uint32_t address, +void *dst, uint32_t num_bytes) { +uint32_t ram_buffer[4]; +uint8_t *ram_ptr = NULL; +uint32_t read_bytes; + +while ((NRF_QSPI->STATUS & QSPI_STATUS_READY_Msk) == 0) +; + +while (num_bytes != 0) { +/* + * If address or destination pointer are unaligned or + * number of bytes to read is less then 4 read using ram buffer. + */ +if (((address & 3) != 0) || +uint32_t) dst) & 3) != 0) || +num_bytes < 4) { +uint32_t to_read = (num_bytes + (address & 3) + 3) & ~3; +if (to_read > sizeof(ram_buffer)) { +to_read = sizeof(ram_buffer); +} +ram_ptr = (uint8_t *)((uint32_t) ram_buffer + (address & 3)); +read_bytes = to_read - (address & 3); +if (read_bytes > num_bytes) { +read_bytes = num_bytes; +} +NRF_QSPI->READ.DST = (uint32_t) ram_buffer; +NRF_QSPI->READ.SRC = address & ~3; +NRF_QSPI->READ.CNT = to_read; +} else { +read_bytes = num_bytes & ~3; +NRF_QSPI->READ.DST = (uint32_t) dst; +NRF_QSPI->READ.SRC = address; +NRF_QSPI->READ.CNT = read_bytes; +} +NRF_QSPI->EVENTS_READY = 0; +NRF_QSPI->TASKS_READSTART = 1; +while (NRF_QSPI->EVENTS_READY == 0) +; +if (ram_ptr != NULL) { +memcpy(dst, ram_ptr, read_bytes); +ram_ptr = NULL; +} +address += read_bytes; +dst = (void *) ((uint32_t) dst + read_bytes); +num_bytes -= read_bytes; +} +return
[GitHub] mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash
mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash URL: https://github.com/apache/mynewt-core/pull/1015#discussion_r182447133 ## File path: hw/mcu/nordic/nrf52xxx/src/hal_qspi.c ## @@ -0,0 +1,279 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include "os/mynewt.h" +#if MYNEWT_VAL(QSPI_ENABLE) +#include +#include +#include "mcu/nrf52_hal.h" +#include "nrf.h" +#include + +#if MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT) < 1 +#error QSPI_FLASH_SECTOR_COUNT must be set to the correct value in bsp.yml Review comment: Not in bsp.yml but BSP's syscfg.yml. The same is true for the subsequent #error messages. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash
mkiiskila commented on a change in pull request #1015: nrf52840 support for qspi flash URL: https://github.com/apache/mynewt-core/pull/1015#discussion_r182450858 ## File path: hw/mcu/nordic/nrf52xxx/syscfg.yml ## @@ -114,6 +114,76 @@ syscfg.defs: description: 'SOFT PWM' value: 0 +QSPI_ENABLE: +descritption: 'NRF52 QSPI' +value: 0 + +QSPI_READOC: +descritption: > +QSPI Command to use +0 - 0x09 Fast Read +1 - 0x3B Fast Read Dual Output +2 - 0xBB Fast Read Dual I/O +3 - 0x6B Fast Read Quad Output +4 - 0xEB Fast Read Quad I/O +value: 0 +QSPI_WRITEOC: +descritption: > +QSPI Command to use +0 - 0x02 Page program +1 - 0xA2 Page program Dual Data +2 - 0x32 Page program Quad Data +3 - 0x38 Page program Quad I/O +value: 0 +QSPI_ADDRMODE: +description: 'Address lentgh 0=24 bits, 1=32 bits' +value: 0 +QSPI_DPMCONFIG: +description: 'Deep power mode enable' +value: 0 +QSPI_SCK_DELAY: +description: > +Minimum amount of time that the CSN pin must stay high +before it can go low again. Value is specified in number of 16 +MHz periods (62.5 ns). +value: 0 +QSPI_SCK_FREQ: +description: '32MHz clock divider (0-31). Clock = 32MHz / (1+divider)' +value: 0 +QSPI_SPI_MODE: +description: 'SPI 0=Mode0 or 1=Mode3' +value: 0 + +QSPI_FLASH_SECTOR_SIZE: +description: 'QSPI sector size' +value: 4096 +QSPI_FLASH_PAGE_SIZE: +description: 'QSPI page size. Writes can only be perfrmed to one page at a time.' +value: 256 Review comment: Set default value to 0. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mkiiskila commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
mkiiskila commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#issuecomment-382416609 Good, we need something like this. However, I think this should be a hw/driver interface instead. I'd like to be able to use random number generator from other sources than MCU only; like semtech SX chip which samples radio noise. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] andrzej-kaczmarek commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
andrzej-kaczmarek commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#issuecomment-382425280 @mkiiskila so something like ADC or PWM where we have one package with common code and it requires package implementing `TRNG_HW_IMPL`? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] michal-narajowski opened a new pull request #1038: sys/console: Add console history functionality
michal-narajowski opened a new pull request #1038: sys/console: Add console history functionality URL: https://github.com/apache/mynewt-core/pull/1038 Use up and down arrows to browse history. Duplicate lines are dropped. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mkiiskila commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
mkiiskila commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#issuecomment-382431715 Exactly; I think that kind of flexibility would come handy for this. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sjanc closed pull request #52: nimble/ll: Fix dereferencing NULL pointer in ble_ll_scan_rx_isr_end
sjanc closed pull request #52: nimble/ll: Fix dereferencing NULL pointer in ble_ll_scan_rx_isr_end URL: https://github.com/apache/mynewt-nimble/pull/52 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c index 49d5eda2..4ddad14b 100644 --- a/nimble/controller/src/ble_ll_scan.c +++ b/nimble/controller/src/ble_ll_scan.c @@ -2002,11 +2002,7 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t crcok) /* Get scanning state machine */ scansm = _ble_ll_scan_sm; scanphy = >phy_data[scansm->cur_phy]; -ble_hdr = BLE_MBUF_HDR_PTR(rxpdu); -#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) -ble_hdr->rxinfo.user_data = scansm->cur_aux_data; -#endif /* * The reason we do something different here (as opposed to failed CRC) is * that the received PDU will not be handed up in this case. So we have @@ -2024,6 +2020,12 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t crcok) return 0; } +ble_hdr = BLE_MBUF_HDR_PTR(rxpdu); + +#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) +ble_hdr->rxinfo.user_data = scansm->cur_aux_data; +#endif + /* Just leave if the CRC is not OK. */ rc = -1; if (!crcok) { This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] 01/01: Merge pull request #48 from sjanc/scan_tmo
This is an automated email from the ASF dual-hosted git repository. janc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git commit b043da7b998d2102ce2a5c780f25a1a6cc9e7772 Merge: d378f3d d9f706a Author: Szymon JancAuthorDate: Wed Apr 18 13:27:27 2018 +0200 Merge pull request #48 from sjanc/scan_tmo Support for duration and period in extended scan nimble/controller/include/controller/ble_ll_ctrl.h | 1 + nimble/controller/include/controller/ble_ll_scan.h | 10 +- nimble/controller/src/ble_ll_conn.c| 7 +- nimble/controller/src/ble_ll_hci_ev.c | 22 ++ nimble/controller/src/ble_ll_scan.c| 224 - nimble/host/src/ble_gap.c | 8 + nimble/host/src/ble_gap_priv.h | 4 + nimble/host/src/ble_hs_hci_evt.c | 12 ++ nimble/include/nimble/hci_common.h | 3 + 9 files changed, 233 insertions(+), 58 deletions(-) -- To stop receiving notification emails like this one, please contact j...@apache.org.
[mynewt-nimble] branch master updated (49b0dd6 -> d378f3d)
This is an automated email from the ASF dual-hosted git repository. janc pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. from 49b0dd6 Merge pull request #49 from sjanc/scan_init add 1a7e3d1 nimble/ll: Fix dereferencing NULL pointer in ble_ll_scan_rx_isr_end new d378f3d Merge pull request #52 from sjanc/scan_fix The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: nimble/controller/src/ble_ll_scan.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) -- To stop receiving notification emails like this one, please contact j...@apache.org.
[GitHub] rymanluk opened a new pull request #53: nimble/ll: Fix check for scheduled item.
rymanluk opened a new pull request #53: nimble/ll: Fix check for scheduled item. URL: https://github.com/apache/mynewt-nimble/pull/53 This patch makes sure check is correct when cputime just wrapped up. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] andrzej-kaczmarek opened a new pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
andrzej-kaczmarek opened a new pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037 This is proposed hal_trng which abstracts TRNG (True Random Number Generator) available on many SoCs. It exposed just few simple APIs which should be enough for typical operation: - read single u32 value - fill buffer with random data - blocking and non-blocking This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] branch master updated (d378f3d -> b043da7)
This is an automated email from the ASF dual-hosted git repository. janc pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. from d378f3d Merge pull request #52 from sjanc/scan_fix add 0d619e6 nimble/ll: Remove leftover TODO comment add 9a790bc nimble/ll: Refactor ble_ll_scan_set_enable add ae78a91 nimble/ll: Fix LE Set Scan Enable settings when enabled add 9ba3f72 nimble/ll: Don't build ext scan code if disabled add d8c3ba8 nimble/ll: Add support for duration and period in extended scan add d9f706a nimble/host: Add support for ext scan duration new b043da7 Merge pull request #48 from sjanc/scan_tmo The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: nimble/controller/include/controller/ble_ll_ctrl.h | 1 + nimble/controller/include/controller/ble_ll_scan.h | 10 +- nimble/controller/src/ble_ll_conn.c| 7 +- nimble/controller/src/ble_ll_hci_ev.c | 22 ++ nimble/controller/src/ble_ll_scan.c| 224 - nimble/host/src/ble_gap.c | 8 + nimble/host/src/ble_gap_priv.h | 4 + nimble/host/src/ble_hs_hci_evt.c | 12 ++ nimble/include/nimble/hci_common.h | 3 + 9 files changed, 233 insertions(+), 58 deletions(-) -- To stop receiving notification emails like this one, please contact j...@apache.org.
[mynewt-nimble] 01/01: Merge pull request #52 from sjanc/scan_fix
This is an automated email from the ASF dual-hosted git repository. janc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git commit d378f3d04f74051461ba8c334640ba239f79b18c Merge: 49b0dd6 1a7e3d1 Author: Szymon JancAuthorDate: Wed Apr 18 13:27:18 2018 +0200 Merge pull request #52 from sjanc/scan_fix nimble/ll: Fix dereferencing NULL pointer in ble_ll_scan_rx_isr_end nimble/controller/src/ble_ll_scan.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) -- To stop receiving notification emails like this one, please contact j...@apache.org.
[GitHub] sjanc opened a new pull request #54: nimble/ll: Fix advertising interval validation
sjanc opened a new pull request #54: nimble/ll: Fix advertising interval validation URL: https://github.com/apache/mynewt-nimble/pull/54 For legacy advertising any interval between 0x0020 and 0x4000 is valid as long as min interval is not greater than max interval. For extended advertising any interval between 0x20 and 0xff is valid as long as min interval is not greater than max interval. If intervals provided are outside of value allowed by specificication then Invalid Parmeters error is returned. If the advertising interval range provided by the Host is valid but outside the advertising interval range supported by the Controller, then the Controller shall return the Unsupported Feature or Parameter Value (0x11) error code. Since for now we support only intervals in legacy range we use this code in that case. This was affecting TP/DDI/BI-02-C qualification test case. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] andrzej-kaczmarek commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
andrzej-kaczmarek commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#issuecomment-382447851 @mkiiskila I pushed additional patches which implements the same functionality but as a driver, we can choose now which one looks better ;-) @wes3 yep, I implemented this more or less the same as in NimBLE controller in case of hal :-) as for driver implementation the question is whether this should be generic way of how it works or rather how it is implemented in particular driver - I think the latter is just easier to manage since `hw/drivers/trng` can be just a shim layer without extra logic inside. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#discussion_r182492972 ## File path: apps/trng_test/src/main.c ## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "sysinit/sysinit.h" +#include "os/os.h" +#include "console/console.h" +#include "trng/trng.h" + +static uint8_t buf[1024]; + +int +main(void) +{ +struct trng_dev *trng; + +sysinit(); + +trng = (struct trng_dev *) os_dev_open("nrf_rng", OS_TIMEOUT_NEVER, NULL); +assert(trng); + +//hal_trng_read(buf, sizeof(buf)); +trng_read(trng, buf, sizeof(buf)); +for (int i = 0; i < sizeof(buf); i++) { +console_printf("%02x ", buf[i]); +} +console_printf("\n"); + +while (1) { +//console_printf("%08x\n", (unsigned) hal_trng_get_u32()); Review comment: will this stay here? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#discussion_r182493192 ## File path: hw/bsp/nrf52840pdk/src/hal_bsp.c ## @@ -200,6 +204,13 @@ hal_bsp_init(void) /* Make sure system clocks have started */ hal_system_clock_start(); +hal_trng_init(); + +rc = os_dev_create(_bsp_trng.dev, "nrf_rng", Review comment: wouldn't it be better to call it just `trng`? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#discussion_r182493919 ## File path: apps/trng_test/pkg.yml ## @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +pkg.name: apps/trng_test +pkg.type: app +pkg.description: +pkg.author: "Apache Mynewt" +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: + +pkg.deps: +- kernel/os +- sys/console/full +- hw/drivers/trng/trng_nrf52 Review comment: This breaks abstraction on anything other than `nrf52`, the deps should be `hw/drivers/trng` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] wes3 commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
wes3 commented on issue #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#issuecomment-382439715 I have no issue with the API but I was wondering if the way this would basically work is that this package would have a buffer of N, 32-bit random numbers (or random bytes, whatever). The buffer size can be a mynewt val. When random numbers are generated they come from the buffer and thus incur no time penalty. Once the buffer level gets too low the code will start up the trng and get more random data buffer to put in the buffer. I suspect this is the way you would implement it but just checking. Funny you mention the semtech code. Part of the reason I like this hal is that I would rather use the MCU's TRNG than noise from the chip to generate random numbers. :-) However, in the absence of a TRNG on the mcu, the noise from the semtech chip is a reasonable substitute (although I bet there are cases where it aint random!!!). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mwilliford commented on issue #161: cmake: Use paths relative to project root
mwilliford commented on issue #161: cmake: Use paths relative to project root URL: https://github.com/apache/mynewt-newt/pull/161#issuecomment-382458441 +1 works like a champ! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator
utzig commented on a change in pull request #1037: [RFC] hw/hal: Add HAL for True Random Number Generator URL: https://github.com/apache/mynewt-core/pull/1037#discussion_r182509435 ## File path: hw/mcu/nordic/nrf52xxx/src/hal_trng.c ## @@ -0,0 +1,165 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include "mcu/cmsis_nvic.h" +#include "mcu/nrf52_hal.h" +#include "syscfg/syscfg.h" +#include "hal/hal_trng.h" + +#define min(a, b) ((a) < (b) ? (a) : (b)) + +static uint8_t rng_cache[ MYNEWT_VAL(TRNG_CACHE_LEN) ]; +static uint16_t rng_cache_head; +static uint16_t rng_cache_tail; + +static void +nrf52_rng_start(void) +{ +int sr; + +__HAL_DISABLE_INTERRUPTS(sr); + +NRF_RNG->EVENTS_VALRDY = 0; +NRF_RNG->INTENSET = 1; +NRF_RNG->TASKS_START = 1; + +__HAL_ENABLE_INTERRUPTS(sr); +} + +static void +nrf52_rng_stop(void) +{ +int sr; + +__HAL_DISABLE_INTERRUPTS(sr); + +NRF_RNG->INTENCLR = 1; +NRF_RNG->TASKS_STOP = 1; +NRF_RNG->EVENTS_VALRDY = 0; + +__HAL_ENABLE_INTERRUPTS(sr); +} + +static void +nrf52_rng_irq_handler(void) +{ +if (NRF_RNG->EVENTS_VALRDY) { +NRF_RNG->EVENTS_VALRDY = 0; +rng_cache[rng_cache_tail] = NRF_RNG->VALUE; +rng_cache_tail++; +if (rng_cache_tail >= sizeof(rng_cache)) { +rng_cache_tail = 0; +} +} + +NRF_RNG->INTENCLR = 1; +NRF_RNG->EVENTS_VALRDY = 0; Review comment: This bit was already cleared above, inside the `if`, should it really be cleared again here? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] utzig opened a new pull request #1039: Add stm32 common hal_timer (f4/f7/f3/l1)
utzig opened a new pull request #1039: Add stm32 common hal_timer (f4/f7/f3/l1) URL: https://github.com/apache/mynewt-core/pull/1039 WIP - DO NOT MERGE Common hal_timer infrastructure, currently missing F1x, and might still have some issues. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rymanluk closed pull request #53: nimble/ll: Fix check for scheduled item.
rymanluk closed pull request #53: nimble/ll: Fix check for scheduled item. URL: https://github.com/apache/mynewt-nimble/pull/53 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c index 4b46c0be..e421806d 100644 --- a/nimble/controller/src/ble_ll_sched.c +++ b/nimble/controller/src/ble_ll_sched.c @@ -1399,7 +1399,7 @@ ble_ll_sched_aux_scan(struct ble_mbuf_hdr *ble_hdr, os_cputime_timer_stop(_ble_ll_sched_timer); TAILQ_FOREACH(entry, _ble_ll_sched_q, link) { /* We can insert if before entry in list */ -if (sch->end_time <= entry->start_time) { +if ((int32_t)(sch->end_time - entry->start_time) <= 0) { rc = 0; TAILQ_INSERT_BEFORE(entry, sch, link); sch->enqueued = 1; This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] 01/01: Merge pull request #53 from rymanluk/fix_sched
This is an automated email from the ASF dual-hosted git repository. rymek pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git commit ccc9b80d8531f0b7536ddd301583f1bfbea44ab6 Merge: b043da7 5e81bbf Author: Ćukasz RymanowskiAuthorDate: Wed Apr 18 13:31:59 2018 +0200 Merge pull request #53 from rymanluk/fix_sched nimble/ll: Fix check for scheduled item. nimble/controller/src/ble_ll_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact ry...@apache.org.
[mynewt-nimble] branch master updated (b043da7 -> ccc9b80)
This is an automated email from the ASF dual-hosted git repository. rymek pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. from b043da7 Merge pull request #48 from sjanc/scan_tmo add 5e81bbf nimble/ll: Fix check for scheduled item. new ccc9b80 Merge pull request #53 from rymanluk/fix_sched The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: nimble/controller/src/ble_ll_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact ry...@apache.org.
[GitHub] sterlinghughes commented on issue #919: nimble/mesh: Fix simulator segmentation fault on mesh init
sterlinghughes commented on issue #919: nimble/mesh: Fix simulator segmentation fault on mesh init URL: https://github.com/apache/mynewt-core/pull/919#issuecomment-382528641 when r we fixing conflicts & merging? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 01/01: Merge pull request #1031 from davidzuhn/patch-1
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit f292e9259113689731e50a90e4057ebc63856c5b Merge: 941fccd aa7c9c7 Author: ccollins476adAuthorDate: Wed Apr 18 14:08:13 2018 -0700 Merge pull request #1031 from davidzuhn/patch-1 fix/typo docs/os/core_os/porting/port_os.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[mynewt-core] branch master updated (f292e92 -> 31aa50e)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from f292e92 Merge pull request #1031 from davidzuhn/patch-1 add 1057edc boot_serial: Remove required API "console" new 31aa50e Merge pull request #1019 from ccollins476ad/boot-serial-no-console The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: boot/boot_serial/pkg.yml | 1 - 1 file changed, 1 deletion(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad closed pull request #1031: fix/typo
ccollins476ad closed pull request #1031: fix/typo URL: https://github.com/apache/mynewt-core/pull/1031 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/docs/os/core_os/porting/port_os.rst b/docs/os/core_os/porting/port_os.rst index 406dd41fb..9bafcb8db 100644 --- a/docs/os/core_os/porting/port_os.rst +++ b/docs/os/core_os/porting/port_os.rst @@ -71,7 +71,7 @@ the UART to be mapped to several different pins. For these MCUs, the BSP must specify if and where the UART pins should appear to match the hardware layout of your system. -- If your BSP is already supported my Mynewt, there is no additional +- If your BSP is already supported by Mynewt, there is no additional BSP work involved in porting to your platform. You need only to set the ``bsp`` attribute in your Mynewt target using the :doc:`newt command tool <../../../newt/index>`. @@ -85,7 +85,7 @@ Some OS code depends on the MCU or SoC that the system contains. For example, the MCU may specify the potential memory map of the system - where code and data can reside. -- If your MCU is already supported my Mynewt, there is no additional +- If your MCU is already supported by Mynewt, there is no additional MCU work involved in porting to your platform. You need only to set the ``arch`` attribute in your Mynewt target using the :doc:`newt command tool <../../../newt/index>`. @@ -110,7 +110,7 @@ example, a given CPU core has a specific assembly language instruction set, and may require special cross compiler or compiler settings to use the appropriate instruction set. -- If your CPU architecture is already supported my Mynewt, there is no +- If your CPU architecture is already supported by Mynewt, there is no CPU core work involved in porting to your platform. You need only to set the ``arch`` and ``compiler`` attributes in your Mynewt target using the :doc:`newt command tool <../../../newt/index>`. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 01/01: Merge pull request #1019 from ccollins476ad/boot-serial-no-console
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 31aa50e8c465e4a2776d92c16693548be288cf31 Merge: f292e92 1057edc Author: ccollins476adAuthorDate: Wed Apr 18 14:08:39 2018 -0700 Merge pull request #1019 from ccollins476ad/boot-serial-no-console boot_serial: Remove required API "console" boot/boot_serial/pkg.yml | 1 - 1 file changed, 1 deletion(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad closed pull request #1019: boot_serial: Remove required API "console"
ccollins476ad closed pull request #1019: boot_serial: Remove required API "console" URL: https://github.com/apache/mynewt-core/pull/1019 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml index 1c1f9b595..a0b04e9d4 100644 --- a/boot/boot_serial/pkg.yml +++ b/boot/boot_serial/pkg.yml @@ -34,7 +34,6 @@ pkg.deps: - util/crc pkg.req_apis: -- console - bootloader pkg.cflags.SELFTEST: This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sterlinghughes commented on issue #1010: os: Add os_time_ticks_to_ms
sterlinghughes commented on issue #1010: os: Add os_time_ticks_to_ms URL: https://github.com/apache/mynewt-core/pull/1010#issuecomment-382534636 can we merge? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] vrahane commented on issue #948: Sensors: lis2ds12
vrahane commented on issue #948: Sensors: lis2ds12 URL: https://github.com/apache/mynewt-core/pull/948#issuecomment-382527692 @jacobrosenthal Can you please make changes to the driver based on what me and @matthewwarnes have fixed. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 01/01: Merge pull request #986 from ccollins476ad/test-task
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 3ca3808a00875c0318eca4b5783d9283f1b8f8b2 Merge: 31aa50e 2c6da7f Author: ccollins476adAuthorDate: Wed Apr 18 14:09:27 2018 -0700 Merge pull request #986 from ccollins476ad/test-task Simplify unit tests that run in the OS kernel/sim/src/sim_sched_gen.c | 10 +++- net/ip/mn_socket/test/src/mn_sock_test.c | 5 -- net/ip/mn_socket/test/src/mn_sock_test.h | 17 +++--- net/ip/mn_socket/test/src/mn_sock_util.c | 4 +- .../mn_socket/test/src/testcases/inet_ntop_test.c | 1 + .../mn_socket/test/src/testcases/inet_pton_test.c | 1 + net/ip/mn_socket/test/src/testcases/socket_tests.c | 18 +++--- net/oic/test/src/test_discovery.c | 13 ++--- net/oic/test/src/test_getset.c | 9 ++- net/oic/test/src/test_observe.c| 11 ++-- net/oic/test/src/test_oic.c| 9 --- net/oic/test/src/testcases/oic_tests.c | 39 ++--- test/testutil/include/testutil/testutil.h | 68 +- test/testutil/src/testutil.c | 59 +++ 14 files changed, 152 insertions(+), 112 deletions(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad closed pull request #986: Simplify unit tests that run in the OS
ccollins476ad closed pull request #986: Simplify unit tests that run in the OS URL: https://github.com/apache/mynewt-core/pull/986 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/kernel/sim/src/sim_sched_gen.c b/kernel/sim/src/sim_sched_gen.c index bcc029e09..19d87b057 100644 --- a/kernel/sim/src/sim_sched_gen.c +++ b/kernel/sim/src/sim_sched_gen.c @@ -171,8 +171,16 @@ sim_task_start(struct stack_frame *sf, int rc) task = sf->sf_task; task->t_func(task->t_arg); -/* This should never return */ +/* If a unit test is executing, the test is complete when a task handler + * returns. + */ +#if MYNEWT_VAL(SELFTEST) +void tu_restart(void); +tu_restart(); +#else +/* Otherwise, a task handler should never return. */ assert(0); +#endif } os_stack_t * diff --git a/net/ip/mn_socket/test/src/mn_sock_test.c b/net/ip/mn_socket/test/src/mn_sock_test.c index b3c7845bf..0c775a594 100644 --- a/net/ip/mn_socket/test/src/mn_sock_test.c +++ b/net/ip/mn_socket/test/src/mn_sock_test.c @@ -26,11 +26,6 @@ #include "mn_socket/mn_socket.h" #include "mn_sock_test.h" -#define TEST_STACK_SIZE 4096 -#define TEST_PRIO 22 -os_stack_t test_stack[OS_STACK_ALIGN(TEST_STACK_SIZE)]; -struct os_task test_task; - #define MB_CNT 10 #define MB_SZ 512 static uint8_t test_mbuf_area[MB_CNT * MB_SZ]; diff --git a/net/ip/mn_socket/test/src/mn_sock_test.h b/net/ip/mn_socket/test/src/mn_sock_test.h index d8c6df339..e869b9690 100644 --- a/net/ip/mn_socket/test/src/mn_sock_test.h +++ b/net/ip/mn_socket/test/src/mn_sock_test.h @@ -27,13 +27,16 @@ #include "mn_socket/mn_socket.h" -#define TEST_STACK_SIZE 4096 -#define TEST_PRIO 22 -extern os_stack_t test_stack[]; -struct os_task test_task; +extern struct os_sem test_sem; -struct os_sem test_sem; - -void mn_socket_test_handler(void *arg); +void sock_open_close(void); +void sock_listen(void); +void sock_tcp_connect(void); +void sock_udp_data(void); +void sock_tcp_data(void); +void sock_itf_list(void); +void sock_udp_ll(void); +void sock_udp_mcast_v4(void); +void sock_udp_mcast_v6(void); #endif /* _MN_SOCK_TEST_H */ diff --git a/net/ip/mn_socket/test/src/mn_sock_util.c b/net/ip/mn_socket/test/src/mn_sock_util.c index efc36dd8b..ac8ad7feb 100644 --- a/net/ip/mn_socket/test/src/mn_sock_util.c +++ b/net/ip/mn_socket/test/src/mn_sock_util.c @@ -546,7 +546,7 @@ sum4_readable(void *cb_arg, int err) os_sem_release(_sem); } -static void +void sock_udp_mcast_v4(void) { int loop_if_idx; @@ -646,7 +646,7 @@ sock_udp_mcast_v4(void) mn_close(tx_sock); } -static void +void sock_udp_mcast_v6(void) { int loop_if_idx; diff --git a/net/ip/mn_socket/test/src/testcases/inet_ntop_test.c b/net/ip/mn_socket/test/src/testcases/inet_ntop_test.c index d1a8a604e..88ee93106 100644 --- a/net/ip/mn_socket/test/src/testcases/inet_ntop_test.c +++ b/net/ip/mn_socket/test/src/testcases/inet_ntop_test.c @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + #include "mn_sock_test.h" TEST_CASE(inet_ntop_test) diff --git a/net/ip/mn_socket/test/src/testcases/inet_pton_test.c b/net/ip/mn_socket/test/src/testcases/inet_pton_test.c index 3c503f2cc..ff7013389 100644 --- a/net/ip/mn_socket/test/src/testcases/inet_pton_test.c +++ b/net/ip/mn_socket/test/src/testcases/inet_pton_test.c @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + #include "mn_sock_test.h" TEST_CASE(inet_pton_test) diff --git a/net/ip/mn_socket/test/src/testcases/socket_tests.c b/net/ip/mn_socket/test/src/testcases/socket_tests.c index a1668aa57..82b255065 100644 --- a/net/ip/mn_socket/test/src/testcases/socket_tests.c +++ b/net/ip/mn_socket/test/src/testcases/socket_tests.c @@ -16,16 +16,20 @@ * specific language governing permissions and limitations * under the License. */ + #include "mn_sock_test.h" -TEST_CASE(socket_tests) +TEST_CASE_TASK(socket_tests) { -os_init(NULL); -sysinit(); - os_sem_init(_sem, 0); -os_task_init(_task, "mn_socket_test", mn_socket_test_handler, NULL, - TEST_PRIO, OS_WAIT_FOREVER, test_stack, TEST_STACK_SIZE); -os_start(); +sock_open_close(); +sock_listen(); +sock_tcp_connect(); +sock_udp_data(); +sock_tcp_data(); +sock_itf_list(); +sock_udp_ll(); +sock_udp_mcast_v4(); +sock_udp_mcast_v6(); } diff --git a/net/oic/test/src/test_discovery.c b/net/oic/test/src/test_discovery.c index acc32ee08..f9703cb1a 100644 --- a/net/oic/test/src/test_discovery.c +++ b/net/oic/test/src/test_discovery.c @@ -47,7 +47,7 @@ test_discovery_cb(const char *di, const char *uri, oc_string_array_t types, case 1: TEST_ASSERT(!strcmp(uri,
[mynewt-core] branch master updated (31aa50e -> 3ca3808)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from 31aa50e Merge pull request #1019 from ccollins476ad/boot-serial-no-console add b3dbaab kernel/os - tu_restart on task terminate. add 1a10a60 testutil - TEST_CASE_TASK() for in-OS tests add 1923da3 mn_socket - Use `TEST_CASE_TASK()` add 2c6da7f net/oic - Use `TEST_CASE_TASK()` new 3ca3808 Merge pull request #986 from ccollins476ad/test-task The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: kernel/sim/src/sim_sched_gen.c | 10 +++- net/ip/mn_socket/test/src/mn_sock_test.c | 5 -- net/ip/mn_socket/test/src/mn_sock_test.h | 17 +++--- net/ip/mn_socket/test/src/mn_sock_util.c | 4 +- .../mn_socket/test/src/testcases/inet_ntop_test.c | 1 + .../mn_socket/test/src/testcases/inet_pton_test.c | 1 + net/ip/mn_socket/test/src/testcases/socket_tests.c | 18 +++--- net/oic/test/src/test_discovery.c | 13 ++--- net/oic/test/src/test_getset.c | 9 ++- net/oic/test/src/test_observe.c| 11 ++-- net/oic/test/src/test_oic.c| 9 --- net/oic/test/src/testcases/oic_tests.c | 39 ++--- test/testutil/include/testutil/testutil.h | 68 +- test/testutil/src/testutil.c | 59 +++ 14 files changed, 152 insertions(+), 112 deletions(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[mynewt-core] branch master updated (5f7116b -> ffbebe8)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from 5f7116b Merge pull request #1013 from davidzuhn/fix/error-result add 54938ff net/ip/mn_socket - IPv6 support in mn_inet_pton(). add 175a749 util/parse - Additional parsing functions. add fe4fb44 util/parse - Add doxygen comments. add 697084d mn_inet_pton - unit tests for IPv6. new ffbebe8 Merge pull request #934 from ccollins476ad/parse-fns The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: net/ip/mn_socket/include/mn_socket/mn_socket.h | 4 + net/ip/mn_socket/src/mn_socket_aconv.c | 196 +- net/ip/mn_socket/test/src/mn_sock_test.c | 2 + .../mn_socket/test/src/testcases/inet6_pton_test.c | 90 util/parse/include/parse/parse.h | 228 + util/parse/pkg.yml | 2 +- util/parse/src/parse.c | 198 +- 7 files changed, 612 insertions(+), 108 deletions(-) create mode 100644 net/ip/mn_socket/test/src/testcases/inet6_pton_test.c -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[mynewt-core] 01/01: Merge pull request #934 from ccollins476ad/parse-fns
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit ffbebe89e9e6351cbb4dcbc956d68dfce2a5530b Merge: 5f7116b 697084d Author: ccollins476adAuthorDate: Wed Apr 18 14:19:30 2018 -0700 Merge pull request #934 from ccollins476ad/parse-fns util/parse - Additional parsing functions. net/ip/mn_socket/include/mn_socket/mn_socket.h | 4 + net/ip/mn_socket/src/mn_socket_aconv.c | 196 +- net/ip/mn_socket/test/src/mn_sock_test.c | 2 + .../mn_socket/test/src/testcases/inet6_pton_test.c | 90 util/parse/include/parse/parse.h | 228 + util/parse/pkg.yml | 2 +- util/parse/src/parse.c | 198 +- 7 files changed, 612 insertions(+), 108 deletions(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad closed pull request #934: util/parse - Additional parsing functions.
ccollins476ad closed pull request #934: util/parse - Additional parsing functions. URL: https://github.com/apache/mynewt-core/pull/934 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/net/ip/mn_socket/include/mn_socket/mn_socket.h b/net/ip/mn_socket/include/mn_socket/mn_socket.h index e44c46af7..42b0fefde 100644 --- a/net/ip/mn_socket/include/mn_socket/mn_socket.h +++ b/net/ip/mn_socket/include/mn_socket/mn_socket.h @@ -187,6 +187,10 @@ int mn_close(struct mn_socket *); /* * Address conversion */ + +#define MN_INET_ADDRSTRLEN 16 +#define MN_INET6_ADDRSTRLEN 46 + int mn_inet_pton(int af, const char *src, void *dst); const char *mn_inet_ntop(int af, const void *src, void *dst, int len); diff --git a/net/ip/mn_socket/src/mn_socket_aconv.c b/net/ip/mn_socket/src/mn_socket_aconv.c index b7ce1e7a8..3339172bc 100644 --- a/net/ip/mn_socket/src/mn_socket_aconv.c +++ b/net/ip/mn_socket/src/mn_socket_aconv.c @@ -18,10 +18,194 @@ */ #include #include +#include +#include #include -#include "os/mynewt.h" #include "mn_socket/mn_socket.h" +/** + * Indicates the length of an IPv6 address segment (i.e., 0 to 4 characters + * enclosed by ':'). + */ +static int +mn_inet6_segment_len(const char *s) +{ +int i; + +for (i = 0; s[i] != '\0'; i++) { +if (s[i] == ':') { +break; +} +} + +return i; +} + + +/** + * Counts the number of segments in the specified IPv6 address string. + * + * @param s The input string to parse. + * @param pre On success, the number of segments before the + * "::" string gets written here. 8 if there + * is no "::" string. + * @param mid On success, the number of segments compressed + * by a "::" string gets written here. 0 If + * there is no "::" string. + * @param post On success, the number of segments after + * the "::" string gets written here. 0 If + * there is no "::" string. + * + * @return 0 on success; -1 on failure. + */ +static int +mn_inet6_segment_count(const char *s, int *pre, int *mid, int *post) +{ +bool compressed; +int total_segs; +int seglen; +int off; + +*pre = 0; +*mid = 0; +*post = 0; +compressed = false; + +off = 0; +while (1) { +if (s[off] == ':') { +off++; +} + +seglen = mn_inet6_segment_len(s + off); +if (seglen == 0) { +if (s[off] == '\0') { +break; +} + +if (compressed) { +return -1; +} + +compressed = true; +} else if (!compressed) { +(*pre)++; +} else { +(*post)++; +} + +off += seglen; +} + +total_segs = *pre + *post; +if (!compressed) { +if (total_segs != 8) { +return -1; +} +} else { +*mid = 8 - total_segs; +if (*mid <= 0) { +return -1; +} +} + +return 0; +} + +/** + * Converts a single IPv6 address segment string to four-byte array. + */ +static int +mn_inet6_pton_segment(const char *s, void *dst) +{ +uint16_t u16; +char buf[5]; +char *endptr; +int seglen; + +seglen = mn_inet6_segment_len(s); +if (seglen == 0 || seglen > 4) { +return -1; +} + +memcpy(buf, s, seglen); +buf[seglen] = '\0'; + +u16 = strtoul(buf, , 16); +if (*endptr != '\0') { +return -1; +} + +u16 = htons(u16); +memcpy(dst, , sizeof u16); + +return seglen; +} + +/** + * Converts an IPv6 address string to its binary representation. + */ +static int +mn_inet6_pton(const char *s, void *dst) +{ +uint8_t *u8p; +int post; +int mid; +int pre; +int soff; +int doff; +int rc; +int i; + +rc = mn_inet6_segment_count(s, , , ); +if (rc != 0) { +return rc; +} + +u8p = dst; +soff = 0; +doff = 0; + +for (i = 0; i < pre; i++) { +rc = mn_inet6_pton_segment(s + soff, u8p + doff); +if (rc == -1) { +return rc; +} + +soff += rc + 1; +doff += 2; +} + +if (mid == 0) { +return 0; +} + +/* If the string started with a double-colon, skip one of the colons now. + * Normally this gets skipped during parsing of a leading segment. + */ +if (pre == 0) { +soff++; +} + +/* Skip the second colon. */ +soff++; + +memset(u8p + doff, 0, mid * 2); +doff += mid * 2; + +for (i = 0; i
[mynewt-core] 01/01: Merge pull request #994 from sterlinghughes/config_docs
This is an automated email from the ASF dual-hosted git repository. sterling pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 2b161f33005eb8fe9b3d1bac361d4d2bbaa93bbc Merge: ffbebe8 2324388 Author: Sterling HughesAuthorDate: Wed Apr 18 14:23:36 2018 -0700 Merge pull request #994 from sterlinghughes/config_docs Add configuration documentation docs/os/modules/config/config.rst | 49 - docs/os/modules/sysinitconfig/sysinitconfig.rst | 4 +- docs/os/modules/system_modules.rst | 12 +++ docs/os/os_user_guide.rst | 3 +- sys/config/include/config/config.h | 136 5 files changed, 159 insertions(+), 45 deletions(-) -- To stop receiving notification emails like this one, please contact sterl...@apache.org.
[mynewt-core] branch master updated (ffbebe8 -> 2b161f3)
This is an automated email from the ASF dual-hosted git repository. sterling pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from ffbebe8 Merge pull request #934 from ccollins476ad/parse-fns add d614e3c Add configuration documentation add 6701550 add system modules index add a83df4c rename heading to compile time config add 2324388 Update system_modules.rst new 2b161f3 Merge pull request #994 from sterlinghughes/config_docs The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: docs/os/modules/config/config.rst | 49 - docs/os/modules/sysinitconfig/sysinitconfig.rst | 4 +- docs/os/modules/system_modules.rst | 12 +++ docs/os/os_user_guide.rst | 3 +- sys/config/include/config/config.h | 136 5 files changed, 159 insertions(+), 45 deletions(-) create mode 100644 docs/os/modules/system_modules.rst -- To stop receiving notification emails like this one, please contact sterl...@apache.org.
[GitHub] sterlinghughes closed pull request #994: Add configuration documentation
sterlinghughes closed pull request #994: Add configuration documentation URL: https://github.com/apache/mynewt-core/pull/994 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/docs/os/modules/config/config.rst b/docs/os/modules/config/config.rst index 0fca99f81..0121d315e 100644 --- a/docs/os/modules/config/config.rst +++ b/docs/os/modules/config/config.rst @@ -96,20 +96,20 @@ storage (or dump to console). static int8 foo_val; struct conf_handler my_conf = { - .ch_name = "foo", - .ch_set = foo_conf_set, - .ch_export = foo_conf_export +.ch_name = "foo", +.ch_set = foo_conf_set, +.ch_export = foo_conf_export } static int foo_conf_set(int argc, char **argv, char *val) { - if (argc == 1) { - if (!strcmp(argv[0], "bar")) { -return CONF_VALUE_SET(val, CONF_INT8, foo_val); - } -} -return OS_ENOENT; +if (argc == 1) { +if (!strcmp(argv[0], "bar")) { +return CONF_VALUE_SET(val, CONF_INT8, foo_val); +} +} +return OS_ENOENT; } static int @@ -118,8 +118,8 @@ storage (or dump to console). char buf[4]; conf_str_from_value(CONF_INT8, _val, buf, sizeof(buf)); - func("foo/bar", buf) - return 0; +func("foo/bar", buf) +return 0; } Example: Persist Runtime State @@ -138,19 +138,19 @@ foo_val will continue counting up from where it was before restart. static int8 foo_val; struct conf_handler my_conf = { - .ch_name = "foo", - .ch_set = foo_conf_set +.ch_name = "foo", +.ch_set = foo_conf_set } static int foo_conf_set(int argc, char **argv, char *val) { - if (argc == 1) { - if (!strcmp(argv[0], "bar")) { -return CONF_VALUE_SET(val, CONF_INT8, foo_val); - } -} -return OS_ENOENT; +if (argc == 1) { +if (!strcmp(argv[0], "bar")) { +return CONF_VALUE_SET(val, CONF_INT8, foo_val); +} +} +return OS_ENOENT; } static void @@ -159,15 +159,16 @@ foo_val will continue counting up from where it was before restart. struct os_callout *c = (struct os_callout *)ev; char buf[4]; - foo_val++; + foo_val++; conf_str_from_value(CONF_INT8, _val, buf, sizeof(buf)); - conf_save_one("foo/bar", bar); +conf_save_one("foo/bar", bar); - callout_reset(c, OS_TICKS_PER_SEC * 120); +callout_reset(c, OS_TICKS_PER_SEC * 120); } API -~~~ +-- -.. doxygengroup:: sys_config +.. doxygengroup:: SysConfig :content-only: +:members: diff --git a/docs/os/modules/sysinitconfig/sysinitconfig.rst b/docs/os/modules/sysinitconfig/sysinitconfig.rst index 9bb3cf5ea..f91f8f730 100644 --- a/docs/os/modules/sysinitconfig/sysinitconfig.rst +++ b/docs/os/modules/sysinitconfig/sysinitconfig.rst @@ -1,5 +1,5 @@ -System Configuration and Initialization +Compile-Time Configuration and Initialization +--- .. toctree:: :hidden: diff --git a/docs/os/modules/system_modules.rst b/docs/os/modules/system_modules.rst new file mode 100644 index 0..25f82c507 --- /dev/null +++ b/docs/os/modules/system_modules.rst @@ -0,0 +1,12 @@ +System Modules += + +.. toctree:: + :hidden: + + Config + +This section covers the core system functionality of the Apache Mynewt +Operating System outside of the Kernel itself. This includes how you +count statistics, log data and manage configuration of a device in the +Apache Mynewt platform. diff --git a/docs/os/os_user_guide.rst b/docs/os/os_user_guide.rst index 66e3c9066..85cdaba85 100644 --- a/docs/os/os_user_guide.rst +++ b/docs/os/os_user_guide.rst @@ -5,9 +5,10 @@ OS User Guide :hidden: Kernel + System Hardware Abstraction Porting Guide - System Configuration + Compile-Time Configuration Console This guide provides comprehensive information about Mynewt OS, the diff --git a/sys/config/include/config/config.h b/sys/config/include/config/config.h index 3d4beceda..91604803b 100644 --- a/sys/config/include/config/config.h +++ b/sys/config/include/config/config.h @@ -19,17 +19,19 @@ #ifndef __SYS_CONFIG_H_ #define __SYS_CONFIG_H_ +/** + * @addtogroup SysConfig Configuration of Apache Mynewt System + * @{ + */ + +#include #include -#include "os/mynewt.h" #ifdef __cplusplus extern "C" { #endif -/** - * @defgroup sys_config sys/config package - * @{ - */ +/** @cond INTERNAL_HIDDEN */ #define
[GitHub] sterlinghughes commented on issue #1018: Sensors/BMA2XX - New PR from PR #699 comments
sterlinghughes commented on issue #1018: Sensors/BMA2XX - New PR from PR #699 comments URL: https://github.com/apache/mynewt-core/pull/1018#issuecomment-382535691 oh no, more conflicts! rymanluk/vrahane, can you look this over, merge it, and fix conflicts so we can get this in? The cycle on this PR has been _way_ too long :-) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] branch master updated: nrf52xxx_i2c: Fix to allow hal_i2c_clear_bus to read from input-buffer (#940)
This is an automated email from the ASF dual-hosted git repository. vipulrahane pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git The following commit(s) were added to refs/heads/master by this push: new 5f8a758 nrf52xxx_i2c: Fix to allow hal_i2c_clear_bus to read from input-buffer (#940) 5f8a758 is described below commit 5f8a758bce1a5c5069180fc54912a1879950df2e Author: Niklas CasarilAuthorDate: Thu Apr 19 07:32:43 2018 +1000 nrf52xxx_i2c: Fix to allow hal_i2c_clear_bus to read from input-buffer (#940) * Allow hal_i2c_clear_bus to read from input-buffer regardless of pin direction. Change how settings are applied to GPIO to account for multiple ports (eg. nrf52840) --- hw/mcu/nordic/nrf52xxx/src/hal_i2c.c | 51 ++-- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c index 6c56390..9104ad4 100644 --- a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c +++ b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c @@ -38,6 +38,14 @@ (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)) #define NRF52_SDA_PIN_CONF NRF52_SCL_PIN_CONF +#define NRF52_SCL_PIN_CONF_CLR \ + ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \ + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \ + (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) | \ + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \ + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos)) +#define NRF52_SDA_PIN_CONF_CLRNRF52_SCL_PIN_CONF_CLR + #define NRF52_HAL_I2C_RESOLVE(__n, __v) \ if ((__n) >= NRF52_HAL_I2C_MAX) {\ rc = EINVAL; \ @@ -154,6 +162,19 @@ __ASM volatile ( : "+r" (delay)); } +/** + * Reads the input buffer of the specified pin regardless + * of if it is set as output or input + */ +static int +read_gpio_inbuffer(int pin) +{ +NRF_GPIO_Type *port; +port = HAL_GPIO_PORT(pin); + +return (port->IN >> HAL_GPIO_INDEX(pin)) & 1UL; +} + /* * Clear the bus after reset by clocking 9 bits manually. * This should reset state from (most of) the devices on the other end. @@ -162,26 +183,30 @@ static void hal_i2c_clear_bus(const struct nrf52_hal_i2c_cfg *cfg) { int i; +NRF_GPIO_Type *scl_port, *sda_port; +/* Resolve which GPIO port these pins belong to */ +scl_port = HAL_GPIO_PORT(cfg->scl_pin); +sda_port = HAL_GPIO_PORT(cfg->sda_pin); /* Input connected, standard-low disconnected-high, pull-ups */ -NRF_GPIO->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; -NRF_GPIO->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; +scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; hal_gpio_write(cfg->scl_pin, 1); hal_gpio_write(cfg->sda_pin, 1); -/* Still with input buffer connected, the direction is output */ -NRF_GPIO->DIRSET = ((1 PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF_CLR; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF_CLR; hal_i2c_delay_us(4); for (i = 0; i < 9; i++) { -if (hal_gpio_read(cfg->sda_pin)) { +if (read_gpio_inbuffer(cfg->sda_pin)) { if (i == 0) { /* * Nothing to do here. */ -return; +goto ret; } else { break; } @@ -198,6 +223,11 @@ hal_i2c_clear_bus(const struct nrf52_hal_i2c_cfg *cfg) hal_gpio_write(cfg->sda_pin, 0); hal_i2c_delay_us(4); hal_gpio_write(cfg->sda_pin, 1); + +ret: +/* Restore GPIO config */ +scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; } int @@ -208,6 +238,7 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) struct nrf52_hal_i2c_cfg *cfg; uint32_t freq; int rc; +NRF_GPIO_Type *scl_port, *sda_port; assert(usercfg != NULL); @@ -233,8 +264,12 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) hal_i2c_clear_bus(cfg); -NRF_GPIO->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; -NRF_GPIO->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; +/* Resolve which GPIO port these pins belong to */ +scl_port = HAL_GPIO_PORT(cfg->scl_pin); +sda_port = HAL_GPIO_PORT(cfg->sda_pin); + +scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; regs->PSELSCL = cfg->scl_pin; regs->PSELSDA = cfg->sda_pin; -- To stop receiving notification emails like this one, please contact vipulrah...@apache.org.
[GitHub] vrahane closed pull request #940: nrf52xxx_i2c: Fix to allow hal_i2c_clear_bus to read from input-buffer
vrahane closed pull request #940: nrf52xxx_i2c: Fix to allow hal_i2c_clear_bus to read from input-buffer URL: https://github.com/apache/mynewt-core/pull/940 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c index bc98afff6..1ec75ee15 100644 --- a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c +++ b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c @@ -39,6 +39,14 @@ (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)) #define NRF52_SDA_PIN_CONF NRF52_SCL_PIN_CONF +#define NRF52_SCL_PIN_CONF_CLR \ + ((GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | \ + (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos) | \ + (GPIO_PIN_CNF_PULL_Pullup<< GPIO_PIN_CNF_PULL_Pos) | \ + (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | \ + (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos)) +#define NRF52_SDA_PIN_CONF_CLRNRF52_SCL_PIN_CONF_CLR + #define NRF52_HAL_I2C_RESOLVE(__n, __v) \ if ((__n) >= NRF52_HAL_I2C_MAX) {\ rc = EINVAL; \ @@ -155,6 +163,19 @@ __ASM volatile ( : "+r" (delay)); } +/** + * Reads the input buffer of the specified pin regardless + * of if it is set as output or input + */ +static int +read_gpio_inbuffer(int pin) +{ +NRF_GPIO_Type *port; +port = HAL_GPIO_PORT(pin); + +return (port->IN >> HAL_GPIO_INDEX(pin)) & 1UL; +} + /* * Clear the bus after reset by clocking 9 bits manually. * This should reset state from (most of) the devices on the other end. @@ -163,26 +184,30 @@ static void hal_i2c_clear_bus(const struct nrf52_hal_i2c_cfg *cfg) { int i; +NRF_GPIO_Type *scl_port, *sda_port; +/* Resolve which GPIO port these pins belong to */ +scl_port = HAL_GPIO_PORT(cfg->scl_pin); +sda_port = HAL_GPIO_PORT(cfg->sda_pin); /* Input connected, standard-low disconnected-high, pull-ups */ -NRF_GPIO->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; -NRF_GPIO->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; +scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; hal_gpio_write(cfg->scl_pin, 1); hal_gpio_write(cfg->sda_pin, 1); -/* Still with input buffer connected, the direction is output */ -NRF_GPIO->DIRSET = ((1PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF_CLR; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF_CLR; hal_i2c_delay_us(4); for (i = 0; i < 9; i++) { -if (hal_gpio_read(cfg->sda_pin)) { +if (read_gpio_inbuffer(cfg->sda_pin)) { if (i == 0) { /* * Nothing to do here. */ -return; +goto ret; } else { break; } @@ -199,6 +224,11 @@ hal_i2c_clear_bus(const struct nrf52_hal_i2c_cfg *cfg) hal_gpio_write(cfg->sda_pin, 0); hal_i2c_delay_us(4); hal_gpio_write(cfg->sda_pin, 1); + +ret: +/* Restore GPIO config */ +scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; } int @@ -209,6 +239,7 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) struct nrf52_hal_i2c_cfg *cfg; uint32_t freq; int rc; +NRF_GPIO_Type *scl_port, *sda_port; assert(usercfg != NULL); @@ -234,8 +265,12 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) hal_i2c_clear_bus(cfg); -NRF_GPIO->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; -NRF_GPIO->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; +/* Resolve which GPIO port these pins belong to */ +scl_port = HAL_GPIO_PORT(cfg->scl_pin); +sda_port = HAL_GPIO_PORT(cfg->sda_pin); + +scl_port->PIN_CNF[cfg->scl_pin] = NRF52_SCL_PIN_CONF; +sda_port->PIN_CNF[cfg->sda_pin] = NRF52_SDA_PIN_CONF; regs->PSELSCL = cfg->scl_pin; regs->PSELSDA = cfg->sda_pin; This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] 01/01: Merge pull request #51 from andrzej-kaczmarek/ext-adv-fix
This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git commit 9781315518d83a2807563498137562647b2554bf Merge: ccc9b80 a28837c Author: Andrzej KaczmarekAuthorDate: Wed Apr 18 23:38:42 2018 +0200 Merge pull request #51 from andrzej-kaczmarek/ext-adv-fix Multiple fixes to extended advertising nimble/controller/src/ble_ll_adv.c | 142 - nimble/host/include/host/ble_gap.h | 8 +++ nimble/host/src/ble_gap.c | 7 +- nimble/syscfg.yml | 2 +- 4 files changed, 90 insertions(+), 69 deletions(-) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[GitHub] andrzej-kaczmarek closed pull request #51: Multiple fixes to extended advertising
andrzej-kaczmarek closed pull request #51: Multiple fixes to extended advertising URL: https://github.com/apache/mynewt-nimble/pull/51 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c index 7a1c2a5c..c2def946 100644 --- a/nimble/controller/src/ble_ll_adv.c +++ b/nimble/controller/src/ble_ll_adv.c @@ -185,6 +185,7 @@ struct ble_ll_adv_sm *g_ble_ll_cur_adv_sm; static void ble_ll_adv_make_done(struct ble_ll_adv_sm *advsm, struct ble_mbuf_hdr *hdr); static void ble_ll_adv_sm_init(struct ble_ll_adv_sm *advsm); +static void ble_ll_adv_sm_stop_timeout(struct ble_ll_adv_sm *advsm); #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) static void @@ -454,8 +455,11 @@ ble_ll_adv_pdu_make(uint8_t *dptr, void *pducb_arg, uint8_t *hdr_byte) dptr += BLE_LL_EXT_ADV_DATA_INFO_SIZE; /* AuxPtr */ -assert(AUX_CURRENT(advsm)->sch.enqueued); -offset = AUX_CURRENT(advsm)->start_time - advsm->adv_pdu_start_time; +if (AUX_CURRENT(advsm)->sch.enqueued) { +offset = AUX_CURRENT(advsm)->start_time - advsm->adv_pdu_start_time; +} else { +offset = 0; +} ble_ll_adv_put_aux_ptr(advsm, offset, dptr); return BLE_LL_EXT_ADV_HDR_LEN + ext_hdr_len; @@ -523,9 +527,14 @@ ble_ll_adv_aux_pdu_make(uint8_t *dptr, void *pducb_arg, uint8_t *hdr_byte) } if (aux->ext_hdr & (1 << BLE_LL_EXT_ADV_AUX_PTR_BIT)) { -assert(AUX_NEXT(advsm)->sch.enqueued); - -if (advsm->rx_ble_hdr) { +if (!AUX_NEXT(advsm)->sch.enqueued) { +/* + * Trim data here in case we do not have next aux scheduled. This + * can happen if next aux was outside advertising set period and + * was removed from scheduler. + */ +offset = 0; +} else if (advsm->rx_ble_hdr) { offset = advsm->rx_ble_hdr->rem_usecs + ble_ll_pdu_tx_time_get(12, advsm->sec_phy) + BLE_LL_IFS + 30; offset = AUX_NEXT(advsm)->start_time - advsm->rx_ble_hdr->beg_cputime - @@ -1183,7 +1192,6 @@ ble_ll_adv_aux_schedule_next(struct ble_ll_adv_sm *advsm) ble_ll_adv_aux_calculate(advsm, aux_next, next_aux_data_offset); max_usecs = ble_ll_pdu_tx_time_get(aux_next->payload_len, advsm->sec_phy); -max_usecs += XCVR_PROC_DELAY_USECS; aux_next->start_time = aux->sch.end_time + ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS); @@ -1191,8 +1199,18 @@ ble_ll_adv_aux_schedule_next(struct ble_ll_adv_sm *advsm) sch = _next->sch; sch->start_time = aux_next->start_time - g_ble_ll_sched_offset_ticks; sch->remainder = 0; -sch->end_time = aux_next->start_time + os_cputime_usecs_to_ticks(max_usecs); +sch->end_time = aux_next->start_time + +ble_ll_usecs_to_ticks_round_up(max_usecs); ble_ll_sched_adv_new(_next->sch, ble_ll_adv_aux_scheduled, aux_next); + +/* + * In case duration is set for advertising set we need to check if newly + * scheduled aux will fit inside duration. If not, remove it from scheduler + * so advertising will stop after current aux. + */ +if (advsm->duration && (aux_next->sch.end_time > advsm->adv_end_time)) { +ble_ll_sched_rmv_elem(_next->sch); +} } static void @@ -1242,16 +1260,10 @@ ble_ll_adv_aux_schedule_first(struct ble_ll_adv_sm *advsm) max_usecs = ble_ll_pdu_tx_time_get(aux->payload_len, advsm->sec_phy); } -/* - * XXX: For now, just schedule some additional time so we insure we have - * enough time to do everything we want. - */ -max_usecs += XCVR_PROC_DELAY_USECS; - sch = >sch; sch->start_time = aux->start_time - g_ble_ll_sched_offset_ticks; sch->remainder = 0; -sch->end_time = aux->start_time + os_cputime_usecs_to_ticks(max_usecs); +sch->end_time = aux->start_time + ble_ll_usecs_to_ticks_round_up(max_usecs); ble_ll_sched_adv_new(sch, ble_ll_adv_aux_scheduled, aux); } @@ -1315,6 +1327,16 @@ ble_ll_adv_aux_schedule(struct ble_ll_adv_sm *advsm) ble_ll_adv_aux_set_start_time(advsm); ble_ll_adv_aux_schedule_first(advsm); ble_ll_adv_aux_schedule_next(advsm); + +/* + * In case duration is set for advertising set we need to check if at least + * 1st aux will fit inside duration. If not, stop advertising now so we do + * not start extended advertising event which we cannot finish in time. + */ +if (advsm->duration && +(AUX_CURRENT(advsm)->sch.end_time > advsm->adv_end_time)) { +ble_ll_adv_sm_stop_timeout(advsm); +} } #endif @@ -1545,6 +1567,29 @@ ble_ll_adv_sm_stop(struct ble_ll_adv_sm *advsm) } } +static void
[GitHub] sdalu commented on issue #980: util/button: Use the button id in callback instead of button pointer
sdalu commented on issue #980: util/button: Use the button id in callback instead of button pointer URL: https://github.com/apache/mynewt-core/pull/980#issuecomment-38253 I would prefer to have this small api change merge now. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] branch master updated (ccc9b80 -> 9781315)
This is an automated email from the ASF dual-hosted git repository. andk pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. from ccc9b80 Merge pull request #53 from rymanluk/fix_sched add 1ffdb89 nimble/ll: Remove redundant check add 1d7ce9d nimble/ll: Send number of events in case of advertising timeout add 11acb65 nimble/ll: Handle missing aux gracefully add 214df3e nimble/ll: Fix scheduling for aux packets add 4959a7d nimble/ll: Fix dropping ext advertising events add fdeea2e nimble/ll: Minor code cleanup add b05ea72 nimble/ll: Stop advertising properly after limit occured add a95fb1d nimble/ll: Refactor advertising duration handling add ccc94fc nimble/host: Pass num completed ext adv events to app add a28837c nimble: Fix syscfg description new 9781315 Merge pull request #51 from andrzej-kaczmarek/ext-adv-fix The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: nimble/controller/src/ble_ll_adv.c | 142 - nimble/host/include/host/ble_gap.h | 8 +++ nimble/host/src/ble_gap.c | 7 +- nimble/syscfg.yml | 2 +- 4 files changed, 90 insertions(+), 69 deletions(-) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[mynewt-core] 12/13: Fix stm32f3/f7 restart issues, add timingr
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit a97f28399322528dcab1eec691cefa6a6989f07c Author: Fabio UtzigAuthorDate: Fri Mar 23 09:52:45 2018 -0300 Fix stm32f3/f7 restart issues, add timingr --- hw/bsp/stm32f3discovery/src/hal_bsp.c | 2 +- hw/mcu/stm/stm32_common/src/hal_i2c.c | 5 ++- .../stm/stm32_common/src/stm32_driver_mod_i2c_v2.c | 51 ++ .../stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h | 2 +- 4 files changed, 40 insertions(+), 20 deletions(-) diff --git a/hw/bsp/stm32f3discovery/src/hal_bsp.c b/hw/bsp/stm32f3discovery/src/hal_bsp.c index 0d77cff..cd6f5b7 100644 --- a/hw/bsp/stm32f3discovery/src/hal_bsp.c +++ b/hw/bsp/stm32f3discovery/src/hal_bsp.c @@ -104,7 +104,7 @@ static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_pin_scl = MCU_GPIO_PORTB(8), .hic_pin_af = GPIO_AF4_I2C1, .hic_10bit = 0, -.hic_speed = 10, +.hic_timingr = 0x10420F13,/* 100KHz at 8MHz of SysCoreClock */ }; #endif diff --git a/hw/mcu/stm/stm32_common/src/hal_i2c.c b/hw/mcu/stm/stm32_common/src/hal_i2c.c index 7716f2f..a9c4cf4 100644 --- a/hw/mcu/stm/stm32_common/src/hal_i2c.c +++ b/hw/mcu/stm/stm32_common/src/hal_i2c.c @@ -71,7 +71,6 @@ static struct stm32_hal_i2c *hal_i2c_devs[HAL_I2C_MAX_DEVS] = { #endif }; - int hal_i2c_init(uint8_t i2c_num, void *usercfg) { @@ -86,7 +85,11 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) init = >hid_handle.Init; dev->hid_handle.Instance = cfg->hic_i2c; +#if defined(STM32F3) || defined(STM32F7) +init->Timing = cfg->hic_timingr; +#else init->ClockSpeed = cfg->hic_speed; +#endif if (cfg->hic_10bit) { init->AddressingMode = I2C_ADDRESSINGMODE_10BIT; } else { diff --git a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c index b24ee86..1ad2a10 100644 --- a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c +++ b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c @@ -37,6 +37,7 @@ #define MAX_NBYTE_SIZE 255U static const uint8_t HAL_I2C_MODE_MASTER_SEL = 0x11; +static const uint8_t HAL_NACK = HAL_TIMEOUT + 1; /** * @brief This function handles I2C Communication Timeout. @@ -280,6 +281,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_Custom(I2C_HandleTypeDef *hi2c, uint8_t LastOp) { uint32_t tickstart = 0U; + uint8_t prev_mode = 0; if (hi2c->State == HAL_I2C_STATE_READY) { @@ -289,18 +291,14 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_Custom(I2C_HandleTypeDef *hi2c, /* Init tickstart for timeout management*/ tickstart = HAL_GetTick(); -if (hi2c->Mode != HAL_I2C_MODE_MASTER_SEL) +prev_mode = hi2c->Mode; +if (prev_mode != HAL_I2C_MODE_MASTER_SEL) { if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK) { return HAL_TIMEOUT; } } -else -{ - /* FIXME: with not stop must wait here! why? timing config? */ - os_time_delay(1); -} hi2c->State = HAL_I2C_STATE_BUSY_TX; hi2c->Mode = HAL_I2C_MODE_MASTER; @@ -329,6 +327,17 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_Custom(I2C_HandleTypeDef *hi2c, I2C_TransferConfig(hi2c, DevAddress, hi2c->XferSize, I2C_AUTOEND_MODE, I2C_GENERATE_START_WRITE); } +/* + * Wait RESTART to be accepted + */ +if (prev_mode == HAL_I2C_MODE_MASTER_SEL) +{ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TC, RESET, Timeout, tickstart) != HAL_OK) + { +return HAL_TIMEOUT; + } +} + while (hi2c->XferCount > 0U) { /* Wait until TXIS flag is set */ @@ -435,18 +444,22 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_Custom(I2C_HandleTypeDef *hi2c, * @param Tickstart Tick start value * @retval HAL status */ -static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart) +static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart, uint8_t prev_mode) { while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET) { /* Check if a NACK is detected */ if (I2C_IsAcknowledgeFailed(hi2c, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + return HAL_NACK; } +/* + * FIXME: need to re-check if what is supposed to be a RESTART is not also + * triggering a STOP along... + */ /* Check if a STOPF is detected */ -if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == SET) +if (prev_mode != HAL_I2C_MODE_MASTER_SEL && __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == SET) { /* Clear STOP Flag */ __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); @@ -496,27 +509,25 @@ HAL_StatusTypeDef
[mynewt-core] 03/13: Fix i2c config naming for all f4 bsps
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit e418a77180c42bfa81995312a6997342f8d242e6 Author: Fabio UtzigAuthorDate: Thu Mar 22 09:47:43 2018 -0300 Fix i2c config naming for all f4 bsps --- hw/bsp/nucleo-f401re/src/hal_bsp.c | 2 +- hw/bsp/nucleo-f413re/src/hal_bsp.c | 2 +- hw/bsp/nucleo-f413zh/src/hal_bsp.c | 2 +- hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c | 2 +- hw/bsp/stm32f4discovery/src/hal_bsp.c | 2 +- hw/mcu/stm/stm32f4xx/include/mcu/stm32f4xx_mynewt_hal.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/bsp/nucleo-f401re/src/hal_bsp.c b/hw/bsp/nucleo-f401re/src/hal_bsp.c index 60640bc..65eaf42 100644 --- a/hw/bsp/nucleo-f401re/src/hal_bsp.c +++ b/hw/bsp/nucleo-f401re/src/hal_bsp.c @@ -73,7 +73,7 @@ static const struct hal_bsp_mem_dump dump_cfg[] = { * be removed (they are the default connections) and SB46/SB52 need to * be added. */ -static struct stm32f4_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, diff --git a/hw/bsp/nucleo-f413re/src/hal_bsp.c b/hw/bsp/nucleo-f413re/src/hal_bsp.c index 7938926..31c0dfc 100644 --- a/hw/bsp/nucleo-f413re/src/hal_bsp.c +++ b/hw/bsp/nucleo-f413re/src/hal_bsp.c @@ -59,7 +59,7 @@ static const struct stm32f4_uart_cfg uart_cfg[UART_CNT] = { #endif #if MYNEWT_VAL(I2C_0) -static struct stm32f4_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, diff --git a/hw/bsp/nucleo-f413zh/src/hal_bsp.c b/hw/bsp/nucleo-f413zh/src/hal_bsp.c index d62af86..002fd6e 100644 --- a/hw/bsp/nucleo-f413zh/src/hal_bsp.c +++ b/hw/bsp/nucleo-f413zh/src/hal_bsp.c @@ -59,7 +59,7 @@ static const struct stm32f4_uart_cfg uart_cfg[UART_CNT] = { #endif #if MYNEWT_VAL(I2C_0) -static struct stm32f4_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c index 4170c65..89a1e9d 100644 --- a/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c +++ b/hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c @@ -254,7 +254,7 @@ struct stm32f4_adc_dev_cfg adc3_config = STM32F4_ADC3_DEFAULT_CONFIG; #endif #if MYNEWT_VAL(I2C_0) -static struct stm32f4_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, diff --git a/hw/bsp/stm32f4discovery/src/hal_bsp.c b/hw/bsp/stm32f4discovery/src/hal_bsp.c index b783f9d..3cf3d68 100644 --- a/hw/bsp/stm32f4discovery/src/hal_bsp.c +++ b/hw/bsp/stm32f4discovery/src/hal_bsp.c @@ -62,7 +62,7 @@ static const struct stm32f4_uart_cfg uart_cfg[UART_CNT] = { #endif #if MYNEWT_VAL(I2C_0) -static struct stm32f4_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, diff --git a/hw/mcu/stm/stm32f4xx/include/mcu/stm32f4xx_mynewt_hal.h b/hw/mcu/stm/stm32f4xx/include/mcu/stm32f4xx_mynewt_hal.h index 73a420d..a656886 100644 --- a/hw/mcu/stm/stm32f4xx/include/mcu/stm32f4xx_mynewt_hal.h +++ b/hw/mcu/stm/stm32f4xx/include/mcu/stm32f4xx_mynewt_hal.h @@ -47,7 +47,7 @@ extern "C" { int hal_gpio_init_stm(int pin, GPIO_InitTypeDef *cfg); int hal_gpio_deinit_stm(int pin, GPIO_InitTypeDef *cfg); -struct stm32f4_hal_i2c_cfg { +struct stm32_hal_i2c_cfg { I2C_TypeDef *hic_i2c; volatile uint32_t *hic_rcc_reg;/* RCC register to modify */ uint32_t hic_rcc_dev; /* RCC device ID */ -- To stop receiving notification emails like this one, please contact ut...@apache.org.
[mynewt-core] 10/13: Add i2c driver for F3/F7
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 20e796df31323b54b9f125690286114a773d0b8b Author: Fabio UtzigAuthorDate: Thu Mar 22 14:55:17 2018 -0300 Add i2c driver for F3/F7 This breaks the stm32cube based driver into two different drivers, one which is compiled in if the BSP is based on F1/L1/F4 and another for F3/F7. FIXME: the driver for F3 is using a delay when no stop was sent by previous message, might be due to not enough time between messages, need to check timing register... --- ..._driver_mod_i2c.c => stm32_driver_mod_i2c_v1.c} | 10 +- .../stm/stm32_common/src/stm32_driver_mod_i2c_v2.c | 647 + hw/mcu/stm/stm32f1xx/src/hal_i2c.c | 34 +- 3 files changed, 678 insertions(+), 13 deletions(-) diff --git a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c.c b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v1.c similarity index 95% rename from hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c.c rename to hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v1.c index 367e09f..c6e02a8 100644 --- a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c.c +++ b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v1.c @@ -29,6 +29,8 @@ #include #include +#if !defined(STM32F3) && !defined(STM32F7) + #define I2C_TIMEOUT_BUSY_FLAG 25U /*!< Timeout 25 ms */ #define I2C_NO_OPTION_FRAME 0xU /*!< XferOptions default value */ @@ -125,8 +127,6 @@ static HAL_StatusTypeDef I2C_WaitOnMasterAddressFlagUntilTimeout(I2C_HandleTypeD return HAL_OK; } - - /** * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains * the configuration information for I2C module @@ -345,8 +345,6 @@ static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, return HAL_OK; } - - /** * @brief Transmits in master mode an amount of data in blocking mode. * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains @@ -356,6 +354,7 @@ static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, * @param pData Pointer to data buffer * @param Size Amount of data to be sent * @param Timeout Timeout duration + * @param LastOp If set sends STOP, otherwise no STOP * @retval HAL status */ HAL_StatusTypeDef HAL_I2C_Master_Transmit_Custom(I2C_HandleTypeDef *hi2c, @@ -606,6 +605,7 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t * @param pData Pointer to data buffer * @param Size Amount of data to be sent * @param Timeout Timeout duration + * @param LastOp If set sends STOP, otherwise no STOP * @retval HAL status */ HAL_StatusTypeDef HAL_I2C_Master_Receive_Custom(I2C_HandleTypeDef *hi2c, @@ -852,4 +852,6 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_Custom(I2C_HandleTypeDef *hi2c, } } +#endif /* !defined(STM32F3) && !defined(STM32F7) */ + / (C) COPYRIGHT STMicroelectronics *END OF FILE/ diff --git a/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c new file mode 100644 index 000..b24ee86 --- /dev/null +++ b/hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c @@ -0,0 +1,647 @@ +/** + * COPYRIGHT(c) 2016 STMicroelectronics + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS
[mynewt-core] 08/13: Add initial stm32f3 mcu i2c config
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 0ebe880cf2bfb74d2de931335aa7220c34fcf877 Author: Fabio UtzigAuthorDate: Thu Mar 22 14:53:18 2018 -0300 Add initial stm32f3 mcu i2c config --- hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h| 5 + hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h | 12 hw/mcu/stm/stm32f3xx/syscfg.yml | 4 hw/mcu/stm/stm32f4xx/syscfg.yml | 10 +- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h index 388640e..98d1a5e 100644 --- a/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h +++ b/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h @@ -60,6 +60,11 @@ struct stm32_hal_spi_cfg { int irq_prio; }; +/* hal_i2c */ +#include "stm32f3xx_hal_i2c.h" +#include "mcu/stm32f3xx_mynewt_hal.h" +#include "mcu/stm32f3_bsp.h" + #ifdef __cplusplus } #endif diff --git a/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h b/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h index 0b24798..b4465c0 100644 --- a/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h +++ b/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h @@ -22,6 +22,8 @@ #include "stm32f3xx.h" #include "stm32f3xx_hal_gpio.h" +#include "stm32f3xx_hal_dma.h" +#include "stm32f3xx_hal_i2c.h" #ifdef __cplusplus extern "C" { @@ -45,6 +47,16 @@ extern "C" { int hal_gpio_init_stm(int pin, GPIO_InitTypeDef *cfg); int hal_gpio_deinit_stm(int pin, GPIO_InitTypeDef *cfg); +struct stm32_hal_i2c_cfg { +I2C_TypeDef *hic_i2c; +volatile uint32_t *hic_rcc_reg; /* RCC register to modify */ +uint32_t hic_rcc_dev; /* RCC device ID */ +uint8_t hic_pin_sda; +uint8_t hic_pin_scl; +uint8_t hic_pin_af; +uint8_t hic_10bit; +uint32_t hic_speed; +}; #ifdef __cplusplus } diff --git a/hw/mcu/stm/stm32f3xx/syscfg.yml b/hw/mcu/stm/stm32f3xx/syscfg.yml index 2c23cd7..4ea70c8 100644 --- a/hw/mcu/stm/stm32f3xx/syscfg.yml +++ b/hw/mcu/stm/stm32f3xx/syscfg.yml @@ -58,3 +58,7 @@ syscfg.defs: SPI_1: description: 'SPI 1 enable' value: 'MYNEWT_VAL_SPI_1_MASTER || MYNEWT_VAL_SPI_1_SLAVE' + +I2C_0: +description: 'I2C (TWI) interface 0' +value: 0 diff --git a/hw/mcu/stm/stm32f4xx/syscfg.yml b/hw/mcu/stm/stm32f4xx/syscfg.yml index db33de7..ad8fb54 100644 --- a/hw/mcu/stm/stm32f4xx/syscfg.yml +++ b/hw/mcu/stm/stm32f4xx/syscfg.yml @@ -16,13 +16,9 @@ # under the License. # -# Package: hw/bsp/nrf52dk +# Package: hw/mcu/stm32f4xx syscfg.defs: -I2C_0: -description: 'I2C (TWI) interface 0' -value: 0 - MCU_FLASH_MIN_WRITE_SIZE: description: > Specifies the required alignment for internal flash writes. @@ -33,6 +29,10 @@ syscfg.defs: description: MCUs are of STM32F4xx family value: 1 +I2C_0: +description: 'I2C (TWI) interface 0' +value: 0 + SPI_0_MASTER: description: 'SPI 0 master' value: 0 -- To stop receiving notification emails like this one, please contact ut...@apache.org.
[mynewt-core] 04/13: Add missing i2c addr shift left in probe
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit a3852bd18ff2761f0781f005ccd25df2c9c06ae3 Author: Fabio UtzigAuthorDate: Thu Mar 22 08:52:55 2018 -0300 Add missing i2c addr shift left in probe --- hw/mcu/stm/stm32_common/src/hal_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mcu/stm/stm32_common/src/hal_i2c.c b/hw/mcu/stm/stm32_common/src/hal_i2c.c index 0f829e6..7716f2f 100644 --- a/hw/mcu/stm/stm32_common/src/hal_i2c.c +++ b/hw/mcu/stm/stm32_common/src/hal_i2c.c @@ -159,6 +159,6 @@ hal_i2c_master_probe(uint8_t i2c_num, uint8_t address, uint32_t timo) return -1; } -rc = HAL_I2C_IsDeviceReady(>hid_handle, address, 1, timo); +rc = HAL_I2C_IsDeviceReady(>hid_handle, address << 1, 1, timo); return rc; } -- To stop receiving notification emails like this one, please contact ut...@apache.org.
[mynewt-core] 13/13: Initial stm32f1 i2c support + olimex-p103 config
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 9f4fc4aaf90791b060a64bafa3184e8623b8f387 Author: Fabio UtzigAuthorDate: Fri Mar 23 11:22:45 2018 -0300 Initial stm32f1 i2c support + olimex-p103 config --- hw/bsp/nucleo-f401re/src/hal_bsp.c | 2 +- hw/bsp/olimex-p103/src/hal_bsp.c | 11 +- hw/mcu/stm/stm32_common/src/hal_i2c.c | 77 + hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h | 5 + .../stm32f1xx/include/mcu/stm32f1xx_mynewt_hal.h | 4 +- hw/mcu/stm/stm32f1xx/src/hal_i2c.c | 190 - hw/mcu/stm/stm32f1xx/syscfg.yml| 8 +- 7 files changed, 94 insertions(+), 203 deletions(-) diff --git a/hw/bsp/nucleo-f401re/src/hal_bsp.c b/hw/bsp/nucleo-f401re/src/hal_bsp.c index 05fb6ce..3c43d19 100644 --- a/hw/bsp/nucleo-f401re/src/hal_bsp.c +++ b/hw/bsp/nucleo-f401re/src/hal_bsp.c @@ -86,7 +86,7 @@ static struct stm32_hal_i2c_cfg i2c_cfg0 = { #endif #if MYNEWT_VAL(SPI_0_SLAVE) || MYNEWT_VAL(SPI_0_MASTER) -struct stm32f4_hal_spi_cfg spi0_cfg = { +struct stm32_hal_spi_cfg spi0_cfg = { .ss_pin = MCU_GPIO_PORTA(4),/* PA4 */ .sck_pin = MCU_GPIO_PORTA(5), /* PA5 */ .miso_pin = MCU_GPIO_PORTA(6), /* PA6 */ diff --git a/hw/bsp/olimex-p103/src/hal_bsp.c b/hw/bsp/olimex-p103/src/hal_bsp.c index f06eb71..1c64825 100644 --- a/hw/bsp/olimex-p103/src/hal_bsp.c +++ b/hw/bsp/olimex-p103/src/hal_bsp.c @@ -90,16 +90,15 @@ struct stm32_hal_spi_cfg spi1_cfg = { #endif #if MYNEWT_VAL(I2C_0) -/* TODO */ -static struct stm32f1_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, -.hic_pin_sda = MCU_GPIO_PORTB(9), /* PB9 */ -.hic_pin_scl = MCU_GPIO_PORTB(8), /* PB8 */ -.hic_pin_af = GPIO_AF4_I2C1, +.hic_pin_sda = MCU_GPIO_PORTB(7), +.hic_pin_scl = MCU_GPIO_PORTB(6), +.hic_pin_remap_fn = LL_GPIO_AF_DisableRemap_I2C1, .hic_10bit = 0, -.hic_speed = 10 /* 100kHz */ +.hic_speed = 10, }; #endif diff --git a/hw/mcu/stm/stm32_common/src/hal_i2c.c b/hw/mcu/stm/stm32_common/src/hal_i2c.c index a9c4cf4..83d4fe5 100644 --- a/hw/mcu/stm/stm32_common/src/hal_i2c.c +++ b/hw/mcu/stm/stm32_common/src/hal_i2c.c @@ -71,12 +71,26 @@ static struct stm32_hal_i2c *hal_i2c_devs[HAL_I2C_MAX_DEVS] = { #endif }; +#if defined(STM32F1) +static void +i2c_reset(I2C_HandleTypeDef *hi2c) +{ +__HAL_I2C_DISABLE(hi2c); +hi2c->Instance->CR1 |= I2C_CR1_SWRST; +hi2c->Instance->CR1 &= ~I2C_CR1_SWRST; +__HAL_I2C_ENABLE(hi2c); +} +#endif + int hal_i2c_init(uint8_t i2c_num, void *usercfg) { struct stm32_hal_i2c_cfg *cfg = (struct stm32_hal_i2c_cfg *)usercfg; struct stm32_hal_i2c *dev; I2C_InitTypeDef *init; +#if defined(STM32F1) +GPIO_InitTypeDef gpio; +#endif int rc; if (i2c_num >= HAL_I2C_MAX_DEVS || !(dev = hal_i2c_devs[i2c_num])) { @@ -102,6 +116,7 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) * Configure GPIO pins for I2C. * Enable clock routing for I2C. */ +#if !defined(STM32F1) rc = hal_gpio_init_af(cfg->hic_pin_sda, cfg->hic_pin_af, HAL_GPIO_PULL_UP, 1); if (rc) { @@ -112,7 +127,62 @@ hal_i2c_init(uint8_t i2c_num, void *usercfg) if (rc) { goto err; } + +*cfg->hic_rcc_reg |= cfg->hic_rcc_dev; +#else +/* For STM32F1x initialize I2C clock before GPIOs */ *cfg->hic_rcc_reg |= cfg->hic_rcc_dev; + +if (cfg->hic_pin_remap_fn != NULL) { +cfg->hic_pin_remap_fn(); +} + +/* + * The block below applies a workaround described in 2.13.7 + * of the STM32F103 errata (also described on F105/107 errata). + */ +gpio.Mode = GPIO_MODE_OUTPUT_OD; +gpio.Speed = GPIO_SPEED_FREQ_LOW; +gpio.Pull = GPIO_NOPULL; + +hal_gpio_init_stm(cfg->hic_pin_sda, ); +hal_gpio_write(cfg->hic_pin_sda, 1); +hal_gpio_init_stm(cfg->hic_pin_scl, ); +hal_gpio_write(cfg->hic_pin_scl, 1); + +assert(hal_gpio_read(cfg->hic_pin_sda) == 1); +assert(hal_gpio_read(cfg->hic_pin_scl) == 1); + +hal_gpio_write(cfg->hic_pin_sda, 0); +assert(hal_gpio_read(cfg->hic_pin_sda) == 0); + +hal_gpio_write(cfg->hic_pin_scl, 0); +assert(hal_gpio_read(cfg->hic_pin_scl) == 0); + +hal_gpio_write(cfg->hic_pin_scl, 1); +assert(hal_gpio_read(cfg->hic_pin_scl) == 1); + +hal_gpio_write(cfg->hic_pin_sda, 1); +assert(hal_gpio_read(cfg->hic_pin_sda) == 1); + +/* + * Normal I2C PIN initialization + */ +gpio.Mode = GPIO_MODE_AF_OD; +gpio.Speed = GPIO_SPEED_FREQ_HIGH; +/* NOTE: Pull is not used in AF mode */ +gpio.Pull = GPIO_NOPULL; + +
[mynewt-core] 07/13: Enable I2C module for stm32f3 bsps
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 6de6d41080cb5a93d77b834fd6f4e45e06e3eda8 Author: Fabio UtzigAuthorDate: Thu Mar 22 14:49:05 2018 -0300 Enable I2C module for stm32f3 bsps --- hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h| 2 +- hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h| 2 +- hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h b/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h index 788febc..dea1dd6 100644 --- a/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h +++ b/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h @@ -64,7 +64,7 @@ /* #define HAL_PCCARD_MODULE_ENABLED */ #define HAL_GPIO_MODULE_ENABLED /* #define HAL_HRTIM_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED /* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_IRDA_MODULE_ENABLED */ #define HAL_IWDG_MODULE_ENABLED diff --git a/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h b/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h index 788febc..dea1dd6 100644 --- a/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h +++ b/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h @@ -64,7 +64,7 @@ /* #define HAL_PCCARD_MODULE_ENABLED */ #define HAL_GPIO_MODULE_ENABLED /* #define HAL_HRTIM_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED /* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_IRDA_MODULE_ENABLED */ #define HAL_IWDG_MODULE_ENABLED diff --git a/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h b/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h index bc90027..5640df6 100644 --- a/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h +++ b/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h @@ -64,7 +64,7 @@ /* #define HAL_PCCARD_MODULE_ENABLED */ #define HAL_GPIO_MODULE_ENABLED /* #define HAL_HRTIM_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED /* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_IRDA_MODULE_ENABLED */ #define HAL_IWDG_MODULE_ENABLED -- To stop receiving notification emails like this one, please contact ut...@apache.org.
[mynewt-core] 05/13: Undo previously applied i2c patch to stm32cube
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 847cbcb27205f5ce97704095dfacac3fc597d60c Author: Fabio UtzigAuthorDate: Thu Mar 22 09:23:03 2018 -0300 Undo previously applied i2c patch to stm32cube --- .../STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_i2c.h | 6 +- .../STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c | 85 +++--- hw/mcu/stm/stm32l1xx/src/hal_i2c.c | 172 - 3 files changed, 21 insertions(+), 242 deletions(-) diff --git a/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_i2c.h b/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_i2c.h index 2e67480..3e97f68 100644 --- a/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_i2c.h +++ b/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_i2c.h @@ -165,8 +165,7 @@ typedef enum HAL_I2C_MODE_NONE = 0x00U, /*!< No I2C communication on going */ HAL_I2C_MODE_MASTER = 0x10U, /*!< I2C communication is in Master Mode */ HAL_I2C_MODE_SLAVE = 0x20U, /*!< I2C communication is in Slave Mode*/ - HAL_I2C_MODE_MEM= 0x40U, /*!< I2C communication is in Memory Mode */ - HAL_I2C_MODE_MASTER_SEL = 0x11U/*!< I2C communication is in Master Mode, no stop sent */ + HAL_I2C_MODE_MEM= 0x40U/*!< I2C communication is in Memory Mode */ }HAL_I2C_ModeTypeDef; @@ -514,9 +513,6 @@ HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout); HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout); -HAL_StatusTypeDef HAL_I2C_Master_Transmit_NoStop(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout); -HAL_StatusTypeDef HAL_I2C_Master_Receive_NoStop(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout); - /*** Non-Blocking mode: Interrupt */ HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size); HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size); diff --git a/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c b/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c index 3509ce9..02ab64b 100644 --- a/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c +++ b/hw/mcu/stm/stm32l1xx/src/ext/Drivers/STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c @@ -592,7 +592,7 @@ HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c) * @param Timeout Timeout duration * @retval HAL status */ -static HAL_StatusTypeDef HAL_I2C_Master_Transmit_Common(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout, uint8_t sendStop) +HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) { uint32_t tickstart = 0x00U; @@ -601,12 +601,10 @@ static HAL_StatusTypeDef HAL_I2C_Master_Transmit_Common(I2C_HandleTypeDef *hi2c, if(hi2c->State == HAL_I2C_STATE_READY) { -if (hi2c->Mode != HAL_I2C_MODE_MASTER_SEL) { - /* Wait until BUSY flag is reset */ - if(I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG, tickstart) != HAL_OK) - { -return HAL_BUSY; - } +/* Wait until BUSY flag is reset */ +if(I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG, tickstart) != HAL_OK) +{ + return HAL_BUSY; } /* Process Locked */ @@ -699,15 +697,11 @@ static HAL_StatusTypeDef HAL_I2C_Master_Transmit_Common(I2C_HandleTypeDef *hi2c, } /* Generate Stop */ -if (sendStop) { - SET_BIT(hi2c->Instance->CR1, I2C_CR1_STOP); - hi2c->Mode = HAL_I2C_MODE_NONE; -} else { - hi2c->Mode = HAL_I2C_MODE_MASTER_SEL; -} +SET_BIT(hi2c->Instance->CR1, I2C_CR1_STOP); hi2c->State = HAL_I2C_STATE_READY; - +hi2c->Mode = HAL_I2C_MODE_NONE; + /* Process Unlocked */ __HAL_UNLOCK(hi2c); @@ -719,18 +713,6 @@ static HAL_StatusTypeDef HAL_I2C_Master_Transmit_Common(I2C_HandleTypeDef *hi2c, } } -HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout) -{ - return HAL_I2C_Master_Transmit_Common(hi2c, DevAddress, pData, Size, -
[mynewt-core] branch master updated (bac5f88 -> 9f4fc4a)
This is an automated email from the ASF dual-hosted git repository. utzig pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from bac5f88 Sensors/BMA2XX - New PR from PR #699 comments (#1018) new a9e286f Comment on nucleo-f401 i2c usage new 33f28dc Initial stm32 common i2c based on stm32f4x new e418a77 Fix i2c config naming for all f4 bsps new a3852bd Add missing i2c addr shift left in probe new 847cbcb Undo previously applied i2c patch to stm32cube new 9e0d1ef stm32l1 i2c support new 6de6d41 Enable I2C module for stm32f3 bsps new 0ebe880 Add initial stm32f3 mcu i2c config new 0f84660 Add stm32f3discovery i2c config new 20e796d Add i2c driver for F3/F7 new da66d08 Add i2c support for stm32f7 new a97f283 Fix stm32f3/f7 restart issues, add timingr new 9f4fc4a Initial stm32f1 i2c support + olimex-p103 config The 13 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h |2 +- .../nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h |2 +- hw/bsp/nucleo-f401re/src/hal_bsp.c | 30 +- hw/bsp/nucleo-f413re/src/hal_bsp.c |2 +- hw/bsp/nucleo-f413zh/src/hal_bsp.c |2 +- hw/bsp/olimex-p103/src/hal_bsp.c | 11 +- hw/bsp/olimex_stm32-e407_devboard/src/hal_bsp.c|2 +- .../include/bsp/stm32f3xx_hal_conf.h |2 +- hw/bsp/stm32f3discovery/src/hal_bsp.c | 21 + hw/bsp/stm32f4discovery/src/hal_bsp.c |2 +- hw/bsp/stm32f767-nucleo/src/hal_bsp.c | 28 +- hw/bsp/stm32l152discovery/src/hal_bsp.c|2 +- .../stm/{stm32f4xx => stm32_common}/src/hal_i2c.c | 142 +- .../stm/stm32_common/src/stm32_driver_mod_i2c_v1.c | 857 .../stm/stm32_common/src/stm32_driver_mod_i2c_v2.c | 664 +++ hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h |5 + .../stm32f1xx/include/mcu/stm32f1xx_mynewt_hal.h |4 +- hw/mcu/stm/stm32f1xx/src/hal_i2c.c | 174 - hw/mcu/stm/stm32f1xx/syscfg.yml|8 +- hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h |5 + .../stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h | 12 + hw/mcu/stm/stm32f3xx/syscfg.yml|4 + hw/mcu/stm/stm32f4xx/include/mcu/stm32_hal.h |5 + .../stm32f4xx/include/mcu/stm32f4xx_mynewt_hal.h |2 +- hw/mcu/stm/stm32f4xx/pkg.yml |1 - hw/mcu/stm/stm32f4xx/src/stm32_driver_mod_i2c.c| 5353 hw/mcu/stm/stm32f4xx/syscfg.yml| 10 +- hw/mcu/stm/stm32f7xx/include/mcu/stm32_hal.h |5 + .../stm32f7xx/include/mcu/stm32f7xx_mynewt_hal.h |4 +- hw/mcu/stm/stm32f7xx/src/hal_i2c.c | 177 - hw/mcu/stm/stm32f7xx/syscfg.yml|3 + hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h |5 + .../stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h |2 +- .../STM32L1xx_HAL_Driver/Inc/stm32l1xx_hal_i2c.h |6 +- .../STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_i2c.c | 85 +- hw/mcu/stm/stm32l1xx/src/hal_i2c.c | 172 - 36 files changed, 1784 insertions(+), 6027 deletions(-) rename hw/mcu/stm/{stm32f4xx => stm32_common}/src/hal_i2c.c (51%) create mode 100644 hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v1.c create mode 100644 hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v2.c delete mode 100644 hw/mcu/stm/stm32f1xx/src/hal_i2c.c delete mode 100644 hw/mcu/stm/stm32f4xx/src/stm32_driver_mod_i2c.c delete mode 100644 hw/mcu/stm/stm32f7xx/src/hal_i2c.c delete mode 100644 hw/mcu/stm/stm32l1xx/src/hal_i2c.c -- To stop receiving notification emails like this one, please contact ut...@apache.org.
[mynewt-core] 01/01: Merge pull request #1013 from davidzuhn/fix/error-result
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 5f7116ba142e902f5c2c5f44ba8f7a7dd09b69c1 Merge: 3ca3808 2b13f06 Author: ccollins476adAuthorDate: Wed Apr 18 14:10:48 2018 -0700 Merge pull request #1013 from davidzuhn/fix/error-result docs: use the proper error code in example docs/os/modules/fs/fs/fsutil_write_file.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] vrahane commented on issue #948: Sensors: lis2ds12
vrahane commented on issue #948: Sensors: lis2ds12 URL: https://github.com/apache/mynewt-core/pull/948#issuecomment-382530397 For lis2dw12 that is. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] branch master updated (3ca3808 -> 5f7116b)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from 3ca3808 Merge pull request #986 from ccollins476ad/test-task add 2b13f06 use the proper error code new 5f7116b Merge pull request #1013 from davidzuhn/fix/error-result The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: docs/os/modules/fs/fs/fsutil_write_file.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad closed pull request #1013: docs: use the proper error code in example
ccollins476ad closed pull request #1013: docs: use the proper error code in example URL: https://github.com/apache/mynewt-core/pull/1013 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/docs/os/modules/fs/fs/fsutil_write_file.rst b/docs/os/modules/fs/fs/fsutil_write_file.rst index 500fe374b..79fb685e8 100644 --- a/docs/os/modules/fs/fs/fsutil_write_file.rst +++ b/docs/os/modules/fs/fs/fsutil_write_file.rst @@ -51,7 +51,7 @@ This example creates a 4-byte file. /* Create the parent directory. */ rc = fs_mkdir("/cfg"); -if (rc != 0 && rc != FS_EALREADY) { +if (rc != 0 && rc != FS_EEXIST) { return -1; } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sterlinghughes commented on issue #953: Stm32 common I2C
sterlinghughes commented on issue #953: Stm32 common I2C URL: https://github.com/apache/mynewt-core/pull/953#issuecomment-382533326 @utzig can you merge? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sterlinghughes commented on issue #936: [RFC] hw/bsp: Clean up NRFX config on nrf52840
sterlinghughes commented on issue #936: [RFC] hw/bsp: Clean up NRFX config on nrf52840 URL: https://github.com/apache/mynewt-core/pull/936#issuecomment-382533216 ccan we update . && merge? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sterlinghughes commented on issue #980: util/button: Use the button id in callback instead of button pointer
sterlinghughes commented on issue #980: util/button: Use the button id in callback instead of button pointer URL: https://github.com/apache/mynewt-core/pull/980#issuecomment-382533612 Should we wait for those changes or merge now & fix that in a separate PR? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sterlinghughes commented on issue #961: hw/util: blinker/beeper implementation
sterlinghughes commented on issue #961: hw/util: blinker/beeper implementation URL: https://github.com/apache/mynewt-core/pull/961#issuecomment-382533449 @wes3 can you review & approve? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] sterlinghughes commented on issue #984: hw/util/button: allow to specify eventq
sterlinghughes commented on issue #984: hw/util/button: allow to specify eventq URL: https://github.com/apache/mynewt-core/pull/984#issuecomment-382533897 @sdalu we like variable declarations at the top of functions to make it clear where things are defined. if you are too far from variable declaration to the top of your function, should probably be broken into smaller functions, or that is the theory :-) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 06/13: stm32l1 i2c support
This is an automated email from the ASF dual-hosted git repository. utzig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 9e0d1ef42a7cbbe5776559c03fb4527e46d108f9 Author: Fabio UtzigAuthorDate: Thu Mar 22 09:51:09 2018 -0300 stm32l1 i2c support --- hw/bsp/stm32l152discovery/src/hal_bsp.c | 2 +- hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h| 5 + hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/bsp/stm32l152discovery/src/hal_bsp.c b/hw/bsp/stm32l152discovery/src/hal_bsp.c index 0e8d521..42f88e3 100644 --- a/hw/bsp/stm32l152discovery/src/hal_bsp.c +++ b/hw/bsp/stm32l152discovery/src/hal_bsp.c @@ -69,7 +69,7 @@ static const struct stm32l1_uart_cfg uart_cfg[UART_CNT] = { #endif #if MYNEWT_VAL(I2C_0) -static struct stm32l1_hal_i2c_cfg i2c_cfg0 = { +static struct stm32_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = >APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, diff --git a/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h index ae557e6..77e1435 100644 --- a/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h +++ b/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h @@ -58,6 +58,11 @@ struct stm32_hal_spi_cfg { int irq_prio; }; +/* hal_i2c */ +#include "stm32l1xx_hal_i2c.h" +#include "mcu/stm32l1xx_mynewt_hal.h" +#include "mcu/stm32l1_bsp.h" + #ifdef __cplusplus } #endif diff --git a/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h b/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h index 987b46d..7651c5e 100644 --- a/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h +++ b/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h @@ -48,7 +48,7 @@ extern "C" { int hal_gpio_init_stm(int pin, GPIO_InitTypeDef *cfg); int hal_gpio_deinit_stm(int pin, GPIO_InitTypeDef *cfg); -struct stm32l1_hal_i2c_cfg { +struct stm32_hal_i2c_cfg { I2C_TypeDef *hic_i2c; volatile uint32_t *hic_rcc_reg; /* RCC register to modify */ uint32_t hic_rcc_dev; /* RCC device ID */ -- To stop receiving notification emails like this one, please contact ut...@apache.org.
[GitHub] sjanc opened a new pull request #52: nimble/ll: Fix dereferencing NULL pointer in ble_ll_scan_rx_isr_end
sjanc opened a new pull request #52: nimble/ll: Fix dereferencing NULL pointer in ble_ll_scan_rx_isr_end URL: https://github.com/apache/mynewt-nimble/pull/52 If we are out of buffers NULL rxpdu can be passed to this function. Dereference it only after checking if it is not NULL. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mkiiskila opened a new pull request #1036: os; add os_get_uptime()
mkiiskila opened a new pull request #1036: os; add os_get_uptime() URL: https://github.com/apache/mynewt-core/pull/1036 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mwilliford closed issue #46: ble_ll_scan.c calls ble_ll_scan_init twice, which corrupts g_os_mempool_list
mwilliford closed issue #46: ble_ll_scan.c calls ble_ll_scan_init twice, which corrupts g_os_mempool_list URL: https://github.com/apache/mynewt-nimble/issues/46 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mwilliford commented on issue #46: ble_ll_scan.c calls ble_ll_scan_init twice, which corrupts g_os_mempool_list
mwilliford commented on issue #46: ble_ll_scan.c calls ble_ll_scan_init twice, which corrupts g_os_mempool_list URL: https://github.com/apache/mynewt-nimble/issues/46#issuecomment-382290925 It seems like this issue is fixed, thanks! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad opened a new pull request #1040: mn_socket - Fix build error due to missing include
ccollins476ad opened a new pull request #1040: mn_socket - Fix build error due to missing include URL: https://github.com/apache/mynewt-core/pull/1040 This commit fixes the following build error: ``` Error: repos/apache-mynewt-core/net/ip/mn_socket/src/mn_socket_aconv.c: In function 'mn_inet6_pton_segment': repos/apache-mynewt-core/net/ip/mn_socket/src/mn_socket_aconv.c:139:11: error: implicit declaration of function 'htons' [-Werror=implicit-function-declaration] u16 = htons(u16); ``` `mn_socket_aconv.c` requires `htons`, which is declared in `os/endian.h`. The fix is to include the catch-all header `os/mynewt.h`. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad closed pull request #1040: mn_socket - Fix build error due to missing include
ccollins476ad closed pull request #1040: mn_socket - Fix build error due to missing include URL: https://github.com/apache/mynewt-core/pull/1040 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/net/ip/mn_socket/src/mn_socket_aconv.c b/net/ip/mn_socket/src/mn_socket_aconv.c index 3339172bc..96091165d 100644 --- a/net/ip/mn_socket/src/mn_socket_aconv.c +++ b/net/ip/mn_socket/src/mn_socket_aconv.c @@ -21,6 +21,7 @@ #include #include #include +#include "os/mynewt.h" #include "mn_socket/mn_socket.h" /** This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 01/01: Merge pull request #1040 from ccollins476ad/mn_socket-include-fix
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit 61ad5bb5d042714cfb63c384c0f19509904509fb Merge: 9f4fc4a 7fc6ae8 Author: ccollins476adAuthorDate: Wed Apr 18 15:28:43 2018 -0700 Merge pull request #1040 from ccollins476ad/mn_socket-include-fix mn_socket - Fix build error due to missing include net/ip/mn_socket/src/mn_socket_aconv.c | 1 + 1 file changed, 1 insertion(+) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[mynewt-core] branch master updated (9f4fc4a -> 61ad5bb)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from 9f4fc4a Initial stm32f1 i2c support + olimex-p103 config add 7fc6ae8 mn_socket - Fix build error due to missing include new 61ad5bb Merge pull request #1040 from ccollins476ad/mn_socket-include-fix The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: net/ip/mn_socket/src/mn_socket_aconv.c | 1 + 1 file changed, 1 insertion(+) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[mynewt-nimble] 01/01: Merge pull request #55 from andrzej-kaczmarek/build-fix
This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git commit b270fb6d35141826cfc87993fbf45c25f63658f2 Merge: 9781315 4120b11 Author: Andrzej KaczmarekAuthorDate: Thu Apr 19 01:00:28 2018 +0200 Merge pull request #55 from andrzej-kaczmarek/build-fix nimble/host: Fix build with ext adv disabled nimble/host/src/ble_gap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[GitHub] andrzej-kaczmarek opened a new pull request #55: nimble/host: Fix build with ext adv disabled
andrzej-kaczmarek opened a new pull request #55: nimble/host: Fix build with ext adv disabled URL: https://github.com/apache/mynewt-nimble/pull/55 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] andrzej-kaczmarek commented on issue #55: nimble/host: Fix build with ext adv disabled
andrzej-kaczmarek commented on issue #55: nimble/host: Fix build with ext adv disabled URL: https://github.com/apache/mynewt-nimble/pull/55#issuecomment-38297 trivial build fix after merging #51 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] andrzej-kaczmarek closed pull request #55: nimble/host: Fix build with ext adv disabled
andrzej-kaczmarek closed pull request #55: nimble/host: Fix build with ext adv disabled URL: https://github.com/apache/mynewt-nimble/pull/55 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 4ee72668..cbc7fb81 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -1349,7 +1349,7 @@ ble_gap_rx_conn_complete(struct hci_le_conn_complete *evt, uint8_t instance) */ #if !MYNEWT_VAL(BLE_EXT_ADV) if (ble_gap_adv_active()) { -ble_gap_adv_finished(0, 0, 0); +ble_gap_adv_finished(0, 0, 0, 0); } #endif break; @@ -1588,7 +1588,7 @@ ble_gap_slave_timer(void) ble_gap_slave_reset_state(0); /* Indicate to application that advertising has stopped. */ -ble_gap_adv_finished(0, BLE_HS_ETIMEOUT, 0); +ble_gap_adv_finished(0, BLE_HS_ETIMEOUT, 0, 0); return BLE_HS_FOREVER; } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-nimble] branch master updated (9781315 -> b270fb6)
This is an automated email from the ASF dual-hosted git repository. andk pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git. from 9781315 Merge pull request #51 from andrzej-kaczmarek/ext-adv-fix add 4120b11 nimble/host: Fix build with ext adv disabled new b270fb6 Merge pull request #55 from andrzej-kaczmarek/build-fix The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: nimble/host/src/ble_gap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact a...@apache.org.
[GitHub] ccollins476ad closed pull request #1041: util/parse - Add needed mn_socket dependency.
ccollins476ad closed pull request #1041: util/parse - Add needed mn_socket dependency. URL: https://github.com/apache/mynewt-core/pull/1041 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/util/parse/pkg.yml b/util/parse/pkg.yml index 615a35be6..9c0c719f3 100644 --- a/util/parse/pkg.yml +++ b/util/parse/pkg.yml @@ -30,3 +30,4 @@ pkg.cflags: pkg.deps: - "@apache-mynewt-core/sys/defs" +- "@apache-mynewt-core/net/ip/socket" This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] 01/01: Merge pull request #1041 from ccollins476ad/parse-mn-socket
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git commit f17faef62b210a2ef7c6caaac911d64b9cfcd3e9 Merge: 61ad5bb b98655e Author: ccollins476adAuthorDate: Wed Apr 18 17:45:48 2018 -0700 Merge pull request #1041 from ccollins476ad/parse-mn-socket util/parse - Add needed mn_socket dependency. util/parse/pkg.yml | 1 + 1 file changed, 1 insertion(+) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[mynewt-core] branch master updated (61ad5bb -> f17faef)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from 61ad5bb Merge pull request #1040 from ccollins476ad/mn_socket-include-fix add b98655e util/parse - Add needed mn_socket dependency. new f17faef Merge pull request #1041 from ccollins476ad/parse-mn-socket The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: util/parse/pkg.yml | 1 + 1 file changed, 1 insertion(+) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad opened a new pull request #1042: util/parse - Fix dep: net/ip/{socket => mn_socket}
ccollins476ad opened a new pull request #1042: util/parse - Fix dep: net/ip/{socket => mn_socket} URL: https://github.com/apache/mynewt-core/pull/1042 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[mynewt-core] branch master updated (f17faef -> d68c9d7)
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-core.git. from f17faef Merge pull request #1041 from ccollins476ad/parse-mn-socket add d82076b util/parse - Fix dep: net/ip/{socket => mn_socket} new d68c9d7 Merge pull request #1042 from ccollins476ad/parse-mn-socket The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: util/parse/pkg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.
[GitHub] ccollins476ad closed pull request #1042: util/parse - Fix dep: net/ip/{socket => mn_socket}
ccollins476ad closed pull request #1042: util/parse - Fix dep: net/ip/{socket => mn_socket} URL: https://github.com/apache/mynewt-core/pull/1042 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/util/parse/pkg.yml b/util/parse/pkg.yml index 9c0c719f3..ce8599193 100644 --- a/util/parse/pkg.yml +++ b/util/parse/pkg.yml @@ -30,4 +30,4 @@ pkg.cflags: pkg.deps: - "@apache-mynewt-core/sys/defs" -- "@apache-mynewt-core/net/ip/socket" +- "@apache-mynewt-core/net/ip/mn_socket" This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ccollins476ad opened a new pull request #1041: util/parse - Add needed mn_socket dependency.
ccollins476ad opened a new pull request #1041: util/parse - Add needed mn_socket dependency. URL: https://github.com/apache/mynewt-core/pull/1041 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services