Is is legal to perform 8- or 16-bit accesses to peripheral registers? If so, what are the semantics (e.g. reads are ok, but not writes; writes have proper byte enables; writes go through but unaccessed bytes are effectively written with zero?)
If it matters, I am primarily interested in the GPIO registers.
Thanks,
-hpa
Byte/short access to peripherals
Re: Byte/short access to peripherals
Unfortunately not. I think this does work in some isolated cases (I can't remember which) but it's not supported.
What is your goal with the GPIO registers?
What is your goal with the GPIO registers?
-
- Posts: 29
- Joined: Tue Feb 28, 2017 3:44 am
Re: Byte/short access to peripherals
I'm trying to eliminate every possible cycle of latency I can between an incoming event and its response. Doing byte/word accesses would have eliminated a fair bit of shifting and masking.
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: Byte/short access to peripherals
The need for such access largely depends on what you want to achieve.
What do you want to get with such operations?
Vader[Ben]
What do you want to get with such operations?
Vader[Ben]
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: Byte/short access to peripherals
FWIW, Xtensa has a dedicated shift-and-mask instruction, so it's possible you won't gain as much as you think you'd do.
Wrt your original question: Officially, we guarantee only 32-bit accesses to the port and nothing else. (Except for a few very specific cases as indicated in the TRM; iirc the UART data port is one.)
Unoficially: If it works for you, it works My personal guess would be that the problem will be that the GPIO peripheral doesn't have its byte/word-select lines connected, so chances are that if you do a byte/word write, you write 0's (or whatever else the Xtensa decides to set the bus to) to the other bytes in the port. I see no reason why reading from a non-FIFO-register (like the GPIO registers) wouldn't work.
Wrt your original question: Officially, we guarantee only 32-bit accesses to the port and nothing else. (Except for a few very specific cases as indicated in the TRM; iirc the UART data port is one.)
Unoficially: If it works for you, it works My personal guess would be that the problem will be that the GPIO peripheral doesn't have its byte/word-select lines connected, so chances are that if you do a byte/word write, you write 0's (or whatever else the Xtensa decides to set the bus to) to the other bytes in the port. I see no reason why reading from a non-FIFO-register (like the GPIO registers) wouldn't work.
-
- Posts: 29
- Joined: Tue Feb 28, 2017 3:44 am
Re: Byte/short access to peripherals
That pretty much summarizes what I need to know to do further experimentation. Thank you!
Who is online
Users browsing this forum: No registered users and 97 guests