Hi,
I am using chibios 17.6.0 and GCC 6.3.
I imported demo project for STM32F4-discovery (C:\ChibiStudio\chibios176\demos\STM32\RT-STM32F407-DISCOVERY). When I expand macro chThdSleepMilliseconds in main.c, it shows that constant CH_CFG_ST_FREQUENCY has the value of 1000. But actual value of CH_CFG_ST_FREQUENCY defined in chconf.h is 10000. The value 1000 is taken from file /os/rt/templates/chconf.h
When I change the value in chconf.h and click Build (the hammer icon) it rebuilds all source files. When I change the value in /os/rt/templates/chconf.h it rebuilds nothing. It looks like the compiler uses the right file (the one that is located in project directory).
I tried to verify it in debugger. I was using STM32F4-DISCOVERY board. I changed the CH_CFG_ST_FREQUENCY value to 100000. In main.c I defined the global variable systime_t tim; Right after chSysInit(); i tried to evaluate tim = US2ST(100); After stepping over this line, the variable tim has the value of 0. It should have the value of ((100 * 100000) + 999999) / 1000000 = 10,999999 = 10
Expanding macro US2ST in debugger still shows value of 1000 for the constant CH_CFG_ST_FREQUENCY. But even for the value 1000 it should give the result 1,0999999 = 1.
Am I missing something?
Ondrej
Ignored values in chconf.h Topic is solved
Re: Ignored values in chconf.h
After some more digging I found out, that the variable tim is updated later (i.e. after executing next subroutine call). I don't understand why. However, it has the right value of 10.
It looks like the only bug is displaying wrong value in macro expansion. And navigation to wrong file, when I use F3 (Open declaration). After 2 times of F3 (US2ST - F3, CH_CFG_ST_FREQUENCY - F3) the editor opens wrong file chconf.h located in /os/rt/templates/chconf.
It looks like the only bug is displaying wrong value in macro expansion. And navigation to wrong file, when I use F3 (Open declaration). After 2 times of F3 (US2ST - F3, CH_CFG_ST_FREQUENCY - F3) the editor opens wrong file chconf.h located in /os/rt/templates/chconf.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Ignored values in chconf.h Topic is solved
Hi,
It is possible that Eclipse is making confusion because there are several chconf.h in its paths, try reindexing the project.
Giovanni
It is possible that Eclipse is making confusion because there are several chconf.h in its paths, try reindexing the project.
Giovanni
Who is online
Users browsing this forum: No registered users and 15 guests