Hello,
I am using a STM32F103ZET with a ILI9320 chibios and ugfx.
My i2c devices work fine without the display. Once I initialize the LCD i2c stops working, the LCD works as expected.
For i2c I am using PB6 and PB7 with I2C1.
For the ILI9320 I am using FSMC.
I could not find any HW restrictions in the specs.
Again I looked at the block diagram and recognized that FSMC is even using a different bus, not the AHB.
Anybody any ideas what the problem can be here?
Regards
Michael
STM32F103Z, problems with FSMC and i2c
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F103Z, problems with FSMC and i2c
Hi,
how can I find this out? Any support from chibios or is the only way going through the specs?
Greetings
Michael
how can I find this out? Any support from chibios or is the only way going through the specs?
Greetings
Michael
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F103Z, problems with FSMC and i2c
Hi,
The DMAs used by the ChibiOS drivers are specified in the mcuconf.h of your application. You cannot have at the same time two drivers using the same DMA in active state (after xxxStart()).
I don't know if the LCD uses any DMA, that could explain it.
Giovanni
The DMAs used by the ChibiOS drivers are specified in the mcuconf.h of your application. You cannot have at the same time two drivers using the same DMA in active state (after xxxStart()).
I don't know if the LCD uses any DMA, that could explain it.
Giovanni
Re: STM32F103Z, problems with FSMC and i2c
Hi Giovanni,
thank you for your fast replies
in mcuconf.h I see these defines
#define STM32_I2C_I2C1_DMA_PRIORITY 1
Is that the DMA define you mentioned?
Can I simply change it to any free or is it restricted depending on Device?
Thanks
Michael
thank you for your fast replies
in mcuconf.h I see these defines
#define STM32_I2C_I2C1_DMA_PRIORITY 1
Is that the DMA define you mentioned?
Can I simply change it to any free or is it restricted depending on Device?
Thanks
Michael
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F103Z, problems with FSMC and i2c
Ah sorry, you are using an F1 device whose DMA channels are fixed, you have to consult the channels mapping table in the Reference Manual, see the DMA section.
In some newer devices DMA channels can be remapped.
Giovanni
In some newer devices DMA channels can be remapped.
Giovanni
Re: STM32F103Z, problems with FSMC and i2c
Hi, I have project on STM32F103ZET which used FSMC, and I2C1 - all works fine, but I REMAP I2C1 pins from standard locations (AFIO_MAPR_I2C1_REMAP option active)! May be this is your problem.
Re: STM32F103Z, problems with FSMC and i2c
Hi Alex and Giovanni,
Giovanni for your reply i will try this.
Alex how did you do this?
Like this?
AFIO->MAPR |= AFIO_MAPR_I2C1_REMAP
Btw, I have also CAN running and I see the same there. Once FSMC runs no more CAN or I2C.
Thanks
Michael
Giovanni for your reply i will try this.
Alex how did you do this?
Like this?
AFIO->MAPR |= AFIO_MAPR_I2C1_REMAP
Btw, I have also CAN running and I see the same there. Once FSMC runs no more CAN or I2C.
Thanks
Michael
Re: STM32F103Z, problems with FSMC and i2c
Hi Alex,
as far as I understand it remapping the I2C1 will reassign the physical pins from PB6/7 to PB8/9. Since I am using a Developmentboard and the CANtx is wired to PB8/9 I cannot change.
Thanks
Michael
as far as I understand it remapping the I2C1 will reassign the physical pins from PB6/7 to PB8/9. Since I am using a Developmentboard and the CANtx is wired to PB8/9 I cannot change.
Thanks
Michael
Re: STM32F103Z, problems with FSMC and i2c
I changed STM32_I2C_I2C1_DMA_PRIORITY from 1 to 3, still the same.
Something I observed is that a reset via jtag will not reset the i2c problem. Once I used the LCD and I flash the version without LCD init I need a additional hardwarereset in order to make i2c work again.
That means some settings in the chip are changed which are not reset via a jtag reset.
Any more Ideas?
Thanks for your help.
Michael
Something I observed is that a reset via jtag will not reset the i2c problem. Once I used the LCD and I flash the version without LCD init I need a additional hardwarereset in order to make i2c work again.
That means some settings in the chip are changed which are not reset via a jtag reset.
Any more Ideas?
Thanks for your help.
Michael