utzig edited a comment on issue #1299: [RFC] [NRF52] Remove uint64_t div in watchdog init URL: https://github.com/apache/mynewt-core/pull/1299#issuecomment-408415181 @mkiiskila @wes3 This is mostly a Proof of Concept, based on Marko's comments here: https://github.com/runtimeco/mcuboot/pull/322 Some numbers, based on mcuboot loader: Without watchdog initialization linked in the size is `9660` bytes. With the current watchdog initialization it is `10568`. This amount is due to this code generated because of the `uint64_t` division: ``` /* Convert msec timeout to counts of a 32768 crystal */ expiration = ((uint64_t)expire_msecs * 32768) / 1000; 85c:»··f44f 727a »·mov.w»··r2, #1000»··; 0x3e8 860:»··2300 »·movs»···r3, #0 862:»··03c0 »·lsls»···r0, r0, #15 864:»··0c49 »·lsrs»···r1, r1, #17 866:»··f001 fdd9 »·bl»·241c <__aeabi_uldivmod> NRF_WDT->CRV = (uint32_t)expiration; ``` With the updated code the size is `9860` bytes. I suppose the change would be less significant in a final firmware where `__aeabi_uldivmod` might be linked in anyway, so leaving this here for RFC only 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: [email protected] With regards, Apache Git Services
