If you use standby mode on the stm32l4 then every return from standby requires a "reboot" of ChibiOS. I'm curious how to configure ChibiOS to minimize this cost. I'm doing some things to keep stuff out of initialized memory, but I'm not sure I'm doing the best job. The only device drivers I need are SPI, I2C, and RTC.
Geoffrey
Minimizing "boot" time ?
Moderators: RoccoMarco, barthess
-
- Posts: 87
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 15 times
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Minimizing "boot" time ?
Hi,
Exiting from standby involves reinitializing the clock tree, the time is spent there waiting for PLLs, drivers initialization does not take much time. Reducing initialized memory helps for sure. Avoid those options that require memory manipulation, filling of stacks for example.
Giovanni
Exiting from standby involves reinitializing the clock tree, the time is spent there waiting for PLLs, drivers initialization does not take much time. Reducing initialized memory helps for sure. Avoid those options that require memory manipulation, filling of stacks for example.
Giovanni
-
- Posts: 87
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 15 times
Re: Minimizing "boot" time ?
Thanks ! Just using MSI so no PLLs. Which things might be expensive from memory manipulation besides filling stacks (is that always done ?).
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Minimizing "boot" time ?
Uninitialized variables need zeroing, initialized variables need initialization which is just a bit slower. Note that placing variables into an uninitialized RAM is a dubious advantage because you will still need to initialize them at some point, however it allows to defer initialization.
In general:
- Defer initializations of small variables where applicable but this will not give you huge advantages.
- Put large buffers in uninitialized areas, probably you don't need to clear those at all. The ChibiOS heap is an example, it is not initialized.
- Prefer automatic variables to static ones, static const variables to writable ones.
- In general make your DATA and BSS segments as small as possible.
- Do not initialize (and enable) drivers you don't need or defer the activation with xxxStart().
Giovanni
In general:
- Defer initializations of small variables where applicable but this will not give you huge advantages.
- Put large buffers in uninitialized areas, probably you don't need to clear those at all. The ChibiOS heap is an example, it is not initialized.
- Prefer automatic variables to static ones, static const variables to writable ones.
- In general make your DATA and BSS segments as small as possible.
- Do not initialize (and enable) drivers you don't need or defer the activation with xxxStart().
Giovanni
-
- Posts: 87
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 15 times
Re: Minimizing "boot" time ?
Thanks again ! I think I'm doing most of those things, although I do need to systematically go through all the allocated variables to make sure.
Geoffrey
Geoffrey
Re: Minimizing "boot" time ?
There is this trick that defeats some security mechanisms. You boot the processor, let it run for some number of microseconds and then halt the CPU. To recover the protected FLASH, you need to read SRAM memory, but in your case you should take note of the PC value. Now you have a profile of what costs a lot of time and what doesn't.... Doing performance improvements based on a measurement of the performance is much more effective than just guessing.
Who is online
Users browsing this forum: No registered users and 54 guests