timer bug stm32f411VE
Moderator: Benj
Re: timer bug stm32f411VE
Hi LeighM
I have tried various combinations without success.
Pins pb10 and pb11 are for both channel 1 and channel 2.
I have tried both 0x38 and 0x70.
The sda pin always remains high, therefore the clock never starts.
Do you want me to try using other pins besides pb10 and pb11?
I have tried various combinations without success.
Pins pb10 and pb11 are for both channel 1 and channel 2.
I have tried both 0x38 and 0x70.
The sda pin always remains high, therefore the clock never starts.
Do you want me to try using other pins besides pb10 and pb11?
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
Hi,
Yes, I've fixed it, but haven't yet made it into the office to update the system
I'll dig out the files and attach them here, just a mo ...
Please try these ..
STARM_CAL_I2C.c to go into C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM
32F030R8.fcdx to go into C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\ARM
Yes, I've fixed it, but haven't yet made it into the office to update the system
I'll dig out the files and attach them here, just a mo ...
Please try these ..
STARM_CAL_I2C.c to go into C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM
32F030R8.fcdx to go into C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\ARM
- Attachments
-
- STARM_CAL_I2C.c
- (22.5 KiB) Downloaded 241 times
-
- 32F030R8.fcdx
- (31.12 KiB) Downloaded 216 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
OK, thanks.
I've just remembered that you are using the RC, so here's an updated FCD for that.
I recently spotted some 'gotcha' small print in the datasheet!
I've just remembered that you are using the RC, so here's an updated FCD for that.
I recently spotted some 'gotcha' small print in the datasheet!
- Attachments
-
- 32F030RC.fcdx
- (35.51 KiB) Downloaded 207 times
Re: timer bug stm32f411VE
Hi LeighM
If I select channel 2 with any pin the compiler reports this error.
No error however if I select channel 1.
Device STM32F030xC
C~1>arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -D__SOFTFP__ -Os -DSTM32 -DSTM32F0 -DSTM32F030xC -DUSE_HAL_DRIVER -DHSE_VALUE=30000000 -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\CMSIS\Include -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\CMSIS\Device\ST\STM32F0xx\Include -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\STM32F0xx_HAL_Driver\Inc -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\STM32F0xx_HAL_Driver\Inc\Legacy -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\inc -fmessage-length=0 -fdata-sections -ffunction-sections -w -c "Test_i2c_HW.c" -o "Test_i2c_HW_STM32F030xC_30000000\Test_i2c_HW.o"
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:434:0,
from Test_i2c_HW.c:137:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Transaction_Init_1':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c:503:42: error: 'RCC_PERIPHCLK_I2C2' undeclared (first use in this function)
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_I2C2;
^
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c:503:42: note: each undeclared identifier is reported only once for each function it appears in
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c:504:40: error: 'RCC_I2C2CLKSOURCE_HSI' undeclared (first use in this function)
PeriphClkInit.I2c1ClockSelection = RCC_I2C2CLKSOURCE_HSI;
^
Error(s) in build
C:\Program Files (x86)\Flowcode\Common\Compilers\starm\batch\stm32comp.bat reported error code 1
If I select channel 2 with any pin the compiler reports this error.
No error however if I select channel 1.
Device STM32F030xC
C~1>arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -D__SOFTFP__ -Os -DSTM32 -DSTM32F0 -DSTM32F030xC -DUSE_HAL_DRIVER -DHSE_VALUE=30000000 -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\CMSIS\Include -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\CMSIS\Device\ST\STM32F0xx\Include -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\STM32F0xx_HAL_Driver\Inc -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\stm32cubeF0\Drivers\STM32F0xx_HAL_Driver\Inc\Legacy -IC:\PROGRA~2\Flowcode\Common\COMPIL~1\starm\batch\..\inc -fmessage-length=0 -fdata-sections -ffunction-sections -w -c "Test_i2c_HW.c" -o "Test_i2c_HW_STM32F030xC_30000000\Test_i2c_HW.o"
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:434:0,
from Test_i2c_HW.c:137:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Transaction_Init_1':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c:503:42: error: 'RCC_PERIPHCLK_I2C2' undeclared (first use in this function)
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_I2C2;
^
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c:503:42: note: each undeclared identifier is reported only once for each function it appears in
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM\STARM_CAL_I2C.c:504:40: error: 'RCC_I2C2CLKSOURCE_HSI' undeclared (first use in this function)
PeriphClkInit.I2c1ClockSelection = RCC_I2C2CLKSOURCE_HSI;
^
Error(s) in build
C:\Program Files (x86)\Flowcode\Common\Compilers\starm\batch\stm32comp.bat reported error code 1
Re: timer bug stm32f411VE
Thanks LeighMLeighM wrote:OK, thanks, I'll investigate
As you know in Italy there is a complete lock-down.
At this moment I managed to bring home as much material as possible but the board I work on has the pins of the i2c2 on pb10 and pb11.
If you think it would be useful to check the other channels too, let me know that I find a way to solder two pins.
Regards
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
Yes, coronavirus is hitting everything, stay safe
Here's an updated file to try, to go into C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM
Here's an updated file to try, to go into C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM
- Attachments
-
- STARM_CAL_I2C.c
- (22.21 KiB) Downloaded 227 times
Re: timer bug stm32f411VE
The errors at the time of compilation have disappeared but unfortunately it does not work.
For double chek I tried to write using the cal i2c software and it worked. ( the same pin )
For double chek I tried to write using the cal i2c software and it worked. ( the same pin )
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
Thanks for your tests.
I now have channel 2 working
please use attached files
Thanks,
Leigh
I now have channel 2 working
please use attached files
Thanks,
Leigh
- Attachments
-
- STARM_CAL_I2C.c
- (22.25 KiB) Downloaded 226 times
-
- 32F030RC.fcdx
- (35.51 KiB) Downloaded 176 times
-
- 32F030R8.fcdx
- (31.26 KiB) Downloaded 183 times
-
- 32F030Nucleo64.fcdx
- (29.26 KiB) Downloaded 170 times
Re: timer bug stm32f411VE
HI LeighLeighM wrote:Thanks for your tests.
I now have channel 2 working![]()
please use attached files
Thanks,
Leigh
I confirm that I also have the signal.
Only thing is the clock pin scl. If you set 100Khz on flowocode on the oscilloscope, it displays about 500Khz!, If I set 400 Khz the signal goes to over 1 Mhz
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
Thanks for the info.
Yes, getting the timing correct is tricky, it depends on the clock config settings.
Can you live with that for now in your project?
I will have to have a longer term think about how we get Flowcode to understand the clock settings.
Thanks
Leigh
Yes, getting the timing correct is tricky, it depends on the clock config settings.
Can you live with that for now in your project?
I will have to have a longer term think about how we get Flowcode to understand the clock settings.
Thanks
Leigh
Re: timer bug stm32f411VE
For sure.
500 khz is more than enough!
in the next few days I will try to program the dsp and check that everything is working properly.
I am checking the sda pin and the transmission seems correct!
I'll update you as soon as I can program the dsp!
edit:
I don't know if you know this st tool, in case it might help
500 khz is more than enough!
in the next few days I will try to program the dsp and check that everything is working properly.
I am checking the sda pin and the transmission seems correct!
I'll update you as soon as I can program the dsp!
edit:
I don't know if you know this st tool, in case it might help
- Attachments
-
- en.stsw-stm32126.zip
- (241.57 KiB) Downloaded 178 times
Re: timer bug stm32f411VE
Hi Leigh
I managed to program the DSP!
Furthermore, I did some tests with the i2c timing calculation file and the starm_I2c file.
If I go to assign the value generated through the spreadsheet to MX_I2C_HANDLE_X.Init.Timing I get the correct i2c clock.
For example with my clock to generate 400 Khz I have to set this value 0x00901A53.
How can I assign this value directly via flowcode (for example with a c icon) without having to edit the STARM_I2C_c file?
I managed to program the DSP!
Furthermore, I did some tests with the i2c timing calculation file and the starm_I2c file.
If I go to assign the value generated through the spreadsheet to MX_I2C_HANDLE_X.Init.Timing I get the correct i2c clock.
For example with my clock to generate 400 Khz I have to set this value 0x00901A53.
How can I assign this value directly via flowcode (for example with a c icon) without having to edit the STARM_I2C_c file?
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
Ah, well done!
Thanks for the update.
Thanks for the update.
I will have a think on that oneHow can I assign this value directly via flowcode (for example with a c icon) without having to edit the STARM_I2C_c file?
Re: timer bug stm32f411VE
Hi BenjBenj wrote:Hello,
Turning off toggle CS property should help a little bit.
I can see another potential optimisation we could do. I'll have a crack at it for you and see how I get on.
I tried to do what you suggested but the speed didn't improve.
I notice that from the moment of POWER ON to the beginning of the writing on the display almost 2 seconds pass comparable with the time it takes the macro clear.
edit:I checked the compiled c code and the display init macro contains the clear command responsible for the delay.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: timer bug stm32f411VE
Making this user configurable is a long term job, so I've updated our version to match your value.For example with my clock to generate 400 Khz I have to set this value 0x00901A53.
How can I assign this value directly via flowcode (for example with a c icon) without having to edit the STARM_I2C_c file?
This should be available at some point in the auto update system. (Ben is currently doing this when he can get access)