You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I add an I2C shared bus/device (rm_comms_i2c) via the e2studio, it creates the g_comms_i2c_bus<busname>_recursive_mutex_handle and g_comms_i2c_bus<busname>_blocking_semaphore_handle in ra_gen/common_data.c, but it is never initialised. I might expect it to be initialised in the RM_COMMS_I2C_Open:
Possibly I didn't set some configuration setting, but I would expect the I2C mutex/semaphore to be initialised like this too. I couldn't find a different function to initialise it either. Especially since the actual mutex isn't declared in the header, so it seems like it shouldn't be user visible (which makes sense, it is internal to RM_COMMS_I2C). But without initialising the mutex/semaphore, I cannot use the I2C shared bus.
For now I've worked around this, by initialising it in src/hal_entry.c which isn't autogenerated:
(Also as an aside, the UART uses the abstracted type rm_comms_mutex_t/rm_comms_semaphore_t from ra/fsp/src/rm_comms_lock/rm_comms_lock.h whereas the I2C just uses the TX_MUTEX/SemaphoreHandle_t)
The text was updated successfully, but these errors were encountered:
Hi,
If I add an I2C shared bus/device (
rm_comms_i2c
) via the e2studio, it creates theg_comms_i2c_bus<busname>_recursive_mutex_handle
andg_comms_i2c_bus<busname>_blocking_semaphore_handle
inra_gen/common_data.c
, but it is never initialised. I might expect it to be initialised in theRM_COMMS_I2C_Open
:fsp/ra/fsp/src/rm_comms_i2c/rm_comms_i2c.c
Lines 88 to 132 in ba7104e
If you contrast this with the UART CDC (
rm_comms_uart
), then it has a mutex inra_gen/hal_data.c
, which is initialised inRM_COMMS_UART_Open
fsp/ra/fsp/src/rm_comms_uart/rm_comms_uart.c
Lines 73 to 139 in ba7104e
Possibly I didn't set some configuration setting, but I would expect the I2C mutex/semaphore to be initialised like this too. I couldn't find a different function to initialise it either. Especially since the actual mutex isn't declared in the header, so it seems like it shouldn't be user visible (which makes sense, it is internal to RM_COMMS_I2C). But without initialising the mutex/semaphore, I cannot use the I2C shared bus.
For now I've worked around this, by initialising it in
src/hal_entry.c
which isn't autogenerated:(Also as an aside, the UART uses the abstracted type
rm_comms_mutex_t
/rm_comms_semaphore_t
from ra/fsp/src/rm_comms_lock/rm_comms_lock.h whereas the I2C just uses theTX_MUTEX
/SemaphoreHandle_t
)The text was updated successfully, but these errors were encountered: