Trying to Assign a Value to a Pointer of a FIC_3 Address to Flash User LED on Icicle Kit #411
-
Hello,I am experimenting with the polarfire-soc-bare-metal-examples and I am running into an issue when trying to assign a value to a pointer.My goal:I want to modify the mpfs-mmuart-interrupt bare metal example to take user input from the UART and adjust the frequency at which one of the user LEDs blinks. What I have accomplished:I have broken this down into two parts - getting the LED to blink and getting the mpfs-mmuart-interrupt example to workI have built upon the Icicle Kit Reference Design to include a custom IP that flashes LED0 ~2 seconds. The custom IP takes FIC_3_PCLK as input and a simple counter is used to drop the frequency down so that the flash of the LED can be seen. I have run the mpfs-mmuart-interrupt through SoftConsole and was able to read in input and print text to the UART. Currently, I have migrated the two and made changes to both the custom IP, Icicle Kit Reference Design, and u54_1.c of the mpfs_mmuart-interrupt. In the Icicle Kit Reference Design, I modified the FIC_3_PERIPHERALS by disconnecting FIC_3_0x4000_00xx from the PWM and "Promote to Top Level." I then tied this into the custom IP and modified it to handle the members of FIC_3_0x4000_00xx and to respond to a specific address such as 0x4000_0002. Within the mpfs-mmuart-interrupt, I modified u54_1.c to point to the 0x4000_0002 address; however, when assigning the initial frequency ( I would really appreciate some insight as to how to avoid this issue. Thanks! ...
/* Makes sure that the previous interrupt based transmission is completed
* Alternatively, you could register TX complete handler using
* MSS_UART_set_tx_handler() */
while (0u == MSS_UART_tx_complete(p_uartmap_u54_1))
{
;
}
//Setup for LED Blink
volatile uint32_t *blink_rate = (uint32_t*)0x40000002;
uint32_t blink_rate_local = 100000000;
uint32_t blink_rate_user = 0;
*blink_rate = blink_rate_local;
mcycle_start = readmcycle();
while (1u)
{
if (g_rx_size1 > 0u)
{
//User input to modify blink frequency
blink_rate_user = g_rx_buff1[0u] - '0';
*blink_rate = blink_rate_user * blink_rate_local;
switch (g_rx_buff1[0u])
... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Writing to 0x4000_0002 is a misaligned address as this is a 32 bit write on a 32 bit interface. Could you try writing to 0x4000_0000 and 0x4000_0004 instead? You need to be aligned for this interface (there are strobe signals available for byte level writes on the fabric side). |
Beta Was this translation helpful? Give feedback.
Writing to 0x4000_0002 is a misaligned address as this is a 32 bit write on a 32 bit interface. Could you try writing to 0x4000_0000 and 0x4000_0004 instead? You need to be aligned for this interface (there are strobe signals available for byte level writes on the fabric side).