Page 2 of 2

Re: timer bug stm32f411VE

Posted: Mon Mar 16, 2020 4:27 pm
by LeighM
Sorry, only just noticed your post.
Have you tried Channel 1, as well as Channel 2?
Also, have you tried address 0x38 in the initialise?

Re: timer bug stm32f411VE

Posted: Mon Mar 16, 2020 6:05 pm
by Alkaline
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?

Re: timer bug stm32f411VE

Posted: Tue Mar 17, 2020 11:29 am
by LeighM
Thanks for the feedback.
Looks like I have missed something.
I will try and dig out some hardware and give it a test.

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 12:12 pm
by Alkaline
LeighM wrote:Thanks for the feedback.
Looks like I have missed something.
I will try and dig out some hardware and give it a test.
Hi LeighM

Any updates?

Regards

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 12:17 pm
by LeighM
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

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 12:34 pm
by Alkaline
Hi leigh

This afternoon I will try it.

I'm trying to get as much equipment out of the office as possible so I can debug at home and continue development!

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 12:41 pm
by LeighM
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!

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 4:55 pm
by Alkaline
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

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 5:15 pm
by LeighM
OK, thanks, I'll investigate

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 5:29 pm
by Alkaline
LeighM wrote:OK, thanks, I'll investigate
Thanks LeighM

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

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 5:53 pm
by LeighM
Yes, coronavirus is hitting everything, stay safe
Here's an updated file to try, to go into C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\STARM

Re: timer bug stm32f411VE

Posted: Tue Mar 24, 2020 7:38 pm
by Alkaline
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 )

Re: timer bug stm32f411VE

Posted: Wed Mar 25, 2020 10:59 am
by LeighM
Thanks for your tests.
I now have channel 2 working :D
please use attached files
Thanks,
Leigh

Re: timer bug stm32f411VE

Posted: Wed Mar 25, 2020 11:46 am
by Alkaline
LeighM wrote:Thanks for your tests.
I now have channel 2 working :D
please use attached files
Thanks,
Leigh
HI Leigh

I confirm that I also have the signal. :D :D :D

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

Re: timer bug stm32f411VE

Posted: Wed Mar 25, 2020 11:54 am
by LeighM
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

Re: timer bug stm32f411VE

Posted: Wed Mar 25, 2020 12:16 pm
by Alkaline
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

Re: timer bug stm32f411VE

Posted: Mon Mar 30, 2020 11:02 am
by Alkaline
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?

Re: timer bug stm32f411VE

Posted: Mon Mar 30, 2020 11:18 am
by LeighM
Ah, well done!
Thanks for the update.
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 will have a think on that one

Re: timer bug stm32f411VE

Posted: Mon Mar 30, 2020 11:42 am
by Alkaline
Benj 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.
Hi Benj

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.

Re: timer bug stm32f411VE

Posted: Tue Mar 31, 2020 10:03 am
by LeighM
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?
Making this user configurable is a long term job, so I've updated our version to match your value.
This should be available at some point in the auto update system. (Ben is currently doing this when he can get access)