mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(regi2c): skip regi2c operations when running on FPGA
regi2c (the analog i2c master) is not implemented on FPGA: the REGI2C_RTC_BUSY poll in the regi2c helpers never completes, so the 2nd-stage bootloader hangs until the WDT resets the chip (observed on the ESP32-S31 FPGA, bitstream v5.0.0-most-ip). Stub out the regi2c_impl_* macros in hal/regi2c_impl.h when HAL_CONFIG(ENV_FPGA) is set, so every regi2c call site is skipped on FPGA for all current and future targets.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <stdint.h>
|
||||
#include "esp_rom_caps.h"
|
||||
#include "esp_rom_regi2c.h"
|
||||
#include "hal/config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -46,6 +47,15 @@ void _regi2c_impl_write(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t
|
||||
*/
|
||||
void _regi2c_impl_write_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb, uint8_t data);
|
||||
|
||||
#if HAL_CONFIG(ENV_FPGA)
|
||||
// No REGI2C can be performed on FPGA, skip
|
||||
#define regi2c_impl_read(...) (0)
|
||||
#define regi2c_impl_read_mask(...) (0)
|
||||
#define regi2c_impl_write(...)
|
||||
#define regi2c_impl_write_mask(...)
|
||||
|
||||
#else // !HAL_CONFIG(ENV_FPGA)
|
||||
|
||||
#if NON_OS_BUILD
|
||||
|
||||
/* If compiling for the non-FreeRTOS builds (e.g. bootloader), REGI2C read/write operations are always atomic */
|
||||
@@ -85,7 +95,9 @@ void _regi2c_impl_write_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, ui
|
||||
_regi2c_impl_write_mask(__VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
#endif // NON_OS_BUILD
|
||||
|
||||
#endif // HAL_CONFIG(ENV_FPGA)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user