cancel
Showing results for 
Search instead for 
Did you mean: 

when I use GPIOx_BSRR

zhiwen liu
Associate II
Posted on March 12, 2018 at 12:02

when I use GPIOx_BSRR to contral I/O port, it hint me ''error:  #136: struct ''<unnamed>''  has no field ''BSRR'',why?

can you help me?  0690X00000609yUQAQ.png

what is the meaning?

9 REPLIES 9
Andrew Neil
Evangelist
Posted on March 12, 2018 at 18:04

That's not a 'hint' - that's a full-blown error!

Look at your definition of GPIOF - is it properly defined as a struct? Does that struct actually contain a BSRR field?

Does your chip hardware actually have BSRR?

Posted on March 12, 2018 at 18:23

Right Click on the MODER and go to the definition of the structure. Likely you have a BSRRL and BSRRH, split as two 16-bit words.

If so use a cast to do a 32-bit write

*((uint32_t *)&GPIOF->BSRRL) = 1 << 24;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 12, 2018 at 18:33

I missed nice opportunity several times e.g STM32F723-DISCO at 18$, etc.

So I was thinking about running a script to track prices for most wanted items;) Today I am thinking about P-L496G-CELL01 - I believe it will be discounted as well...

Posted on March 12, 2018 at 18:51

did you mean to post that somewhere else?

Posted on March 12, 2018 at 19:41

I am very sorry for breaking forum etiquette. I'll will avoid posting such things and will use private messaging instead. I do understand your frustration in such cases.

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Talking about etiquette after spending a few months carefully watching all posts on this forum.

I think that post should add a value - it should not re-phrase someone's else post, should help, and not criticize someone for making mistakes.

I also think that those who replies should encourage others to take part in the discussion instead of accepting replies only from the 'stars'...

'Stars' should read replies from regular users to avoid repeating the same solutions, and... give others a chance to be useful...

Just a short comment. I do not want to discuss it.

Posted on March 13, 2018 at 01:43

yes, my chip is stm32f407. According to the official refrence ,

0690X0000060A5ZQAU.png

''BSRR'' should be part of GPIO structure. But why is there no field space? 

should not it be same as MODER or OTYPER?  

Posted on March 13, 2018 at 02:08

Be specific about what library or include file is being pulled in.

Review the GPIO structure being used in this instance, then you'd know what it is looking for, and what exactly is implemented, and how.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 13, 2018 at 02:28

ok, I will try it again. thank you very much.

Posted on March 13, 2018 at 02:44

yes, my chip is stm32f407. It did have two 16-bit words, BRy and BSy. 

But the method you gave me I can not understand now.  I will learn it. thanks a lot.