cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030C6 access GPIOD fail, why?

yuriy
Associate II
Posted on April 15, 2015 at 16:35

During init phase of my program I init all GPIO (A, B, C, D & F) register of STM32F030C6  with some default value. And during access to GPIOD on 0x48000C00 I get exception. If I disable GPIOD everything work as expected.

I can't find any mention about this behavior in datasheet & reference doc for STM32F030 MCU family :(. May be someone could point me on some doc about this.

6 REPLIES 6
Posted on April 15, 2015 at 18:23

A Hard Fault? If so pull the registers out of the core/stack and review their meaning.

Double check you can enable the clock for GPIOD bank, and that it's not stuck at zero.

Show the code, and identify where it fails, not good with symptoms here.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
yuriy
Associate II
Posted on April 16, 2015 at 23:37

Actually, I just try to run ChibiOS 2.6.8 on STM32F030C6. Today I have double checked it init process. And it seams everything is correct. First enable GPIOD clock by setting 0x00100000 in RCC->AHBENR. And then try to init OTYPER register of GPIOD on address 0x48000C00.

Also today I try to run the same code on STM32F030R8T (NUCLEO-F030R8) and GPIOD init without a problem :(.

Yes I understand that STM32F030R8T have one PIN2 on GPIOD, and STM32F030C6 have no any. But why I can't find any mention about forbid to access GPIOD on device which doesn't have any pin on it.

To have possibility to provide patch to ChibiOS I need to have any documental confirm of this behavior.

Posted on April 17, 2015 at 04:21

Yeah, I have about zero responsibility for the documentation, nothing jumped out to me as I skimmed it, didn't look at the errata.

First enable GPIOD clock by setting 0x00100000 in RCC->AHBENR

And did that bit stick if you read it back? If it stayed low that's indicative there's no hardware there.

Discussed with an FAE?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
yuriy
Associate II
Posted on April 17, 2015 at 09:54

As for RCC register AHBENR value after set - 0x005E0014 (0000 0000 0101 1110 0000 0000 0001 0100), so as you can see all GPIO clocks enabled.

Also if I read GPIOD registers by gdb I get 0xFA220080 as initial value for all of them, and when I read GPIOB, GPIOC & GPIOF registers by gdb I get 0x00000000 (with GPIOA I get correct initial value for SWD pins).

If I trace init code by gdb then it show me that on set value in OTYPER register of GPIOD CPU switch in Handler HardFault mode. May be I could read some another register to simplify troubleshooting of this problem?

As for errata of course I had checked it first of all, and didn't find any mention of such behavior.

Sorry could you please explain what do you mean by ''Discussed with an FAE?''.

Posted on April 17, 2015 at 13:21

Sorry could you please explain what do you mean by ''Discussed with an FAE?''.

Field Applications Engineer assigned to your account by ST or your distributor. This is the usual method in the semi-conductor business to communicate with technical staff within the organization. This forum is primarily a ''user'' venue. ie people with varying degrees of experience with the parts, but not people who designed the parts, or wrote the manuals..

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
yuriy
Associate II
Posted on April 17, 2015 at 22:48

Clive1, thanks for explanation about FAE. Unfortunately I don't have any type of such contact. I buy chips from reseller, not from direct distributor.

If some one have, than may be they can drop a line about this issue with STM32F030C6 (and may be another chips of STM32F030 family) to ST.