Is there an intrinsic limit to the width of the bit banding for peripherals for the
Cortex M3?
EFM32 Giant Gecko seems to have a limit of eight bits - bits 8 to 31 does not seem to work.
Is this normal?
Hello shapeshifter,
I am afraid you might be misunderstood.
The bit banding area is so made that one bit is assigned into a word (i.e. 32 bit) address.
Therefore you can handle a certain one bit by using 8 bit load or store instruction. The LSB of the 8 bit data of the LDRB/STRB will be valid.
HTH,
Yasuhiko Koumoto.
The problem I have found is that when assigning a bit alias name to the position in bit alias memory that is supposed to represent one of the bits 8 to 31 in a peripheral register, that alias position does not work,while the alias positions representing any of bits 0 to 7 in the peripheral register work as expected.
It seems to be a Giant Gecko hardware bug.
From: yasuhikokoumoto <community@arm.com>
To: H van Rooyen <shapeshifter_100@yahoo.com>
Sent: Wednesday, March 2, 2016 2:51 AM
Subject: Re: - Cortex M3 peripheral Bit Banding limit?
Cortex M3 peripheral Bit Banding limit?
reply from yasuhikokoumoto in ARM Processors - View the full discussionHello shapeshifter, I am afraid you might be misunderstood.The bit banding area is so made that one bit is assigned into a word (i.e. 32 bit) address.Therefore you can handle a certain one bit by using 8 bit load or store instruction. The LSB of the 8 bit data of the LDRB/STRB will be valid. HTH,Yasuhiko Koumoto.
Reply to this message by replying to this email, or go to the message on ARM Connected Community
Start a new discussion in ARM Processors by email or at ARM Connected Community
Following Cortex M3 peripheral Bit Banding limit? in these streams: Inbox
Not interested in these emails anymore, or want to change how often they come? Update your email preferences. You will need to login to access your user preferences.
Hi there,
There can be several different reasons that bit band doesn't work:
Please note you don't need to use 8-bit load store instructions to access bit 8 to 31. You can use 32-bit/16-bit/8-bit load store instructions to access bit band (just make sure it is aligned transfer).
The choice of the instruction type affects the actual read write transfer size. If the peripheral only support 32-bit read/write, you should use 32-bit load/store instructions.
regards,
Joseph
Hi,
I understand all that, thanks - My defines were based on the ARM one that you point to, but using the predefined names provided by the EFM32 tools.
I have also tested by using a pointer to do the accesses with, using 32 bit writes - it does the same if you use 8 bit writes, as in the bit alias area, only the bit 0 has any relevance.
I have in the mean time tested the tiny gecko too, and the results are the same - bit banding does not work for bits 8 - 31 in the peripheral registers.
It looks like the implementation is broken.
If you have access to one of the EFM32 starter kits, and the free Silabs tools, you can try it and see for yourself.
It would be interesting to see if there are actually M3 implementations out there that fully support peripheral bit banding.
From: jyiu <community@arm.com>
Sent: Wednesday, March 2, 2016 11:34 AM
reply from Joseph Yiu in ARM Processors - View the full discussionHi there, There can be several different reasons that bit band doesn't work:
- Bit band is an optional feature on Cortex-M3/M4. If the option is not implemented, then it won't work. I don't think it is the case here because you said bit 0 to 7 works.
- If the bit band support is handled by C bad macro, it could be a problem of the C macro. An example C macro implementation can be found in ARM application note: Cortex-M3 Embedded Software Development
- MPU configuration blocking bit band alias (I don't think this is the case because it will trigger Memory Management Fault, so you should know that has happened.)
- The bus transfer size used is not supported by the peripheral (see below).
Please note you don't need to use 8-bit load store instructions to access bit 8 to 31. You can use 32-bit/16-bit/8-bit load store instructions to access bit band (just make sure it is aligned transfer).The choice of the instruction type affects the actual read write transfer size. If the peripheral only support 32-bit read/write, you should use 32-bit load/store instructions. regards,Joseph
View all questions in Cortex-M / M-Profile forum