I’m working on integrating the HM01B0 camera module with a SparkFun MicroMod Artemis Processor mounted on the Machine Learning Carrier Board. I’m using the SparkFun HM01B0 Arduino Library, but I’m encountering several issues when trying to run the Example1_StopMotion
sketch.
When using the code from the main
branch, I get a “platform not supported” error. To work around this, I switched to the AddMicroMod
branch. However, the pin configuration defined in SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h
does not match the documentation provided in the MicroMod Machine Learning Carrier Board Hookup Guide.
To address this, I manually attempted to map the pins according to the configuration found in the library:
#elif defined(ARDUINO_AM_AP3_SFE_ARTEMIS_MICROMOD)
// These will be in the MM variant
#define G0 40
#define G1 42
#define G2 44
#define G3 46
#define G4 47
#define G5 73
#define G6 71
#define G7 69
#define CAM_MCLK 56 // On PB rev v15
#define CAM_PCLK 54
#define CAM_HSYNC 65
#define CAM_VSYNC 63
#define I2C_INT 16
#define D1 18
// Camera to MM pin mapping
#define HM01B0_PIN_D0 G0
#define HM01B0_PIN_D1 G1
#define HM01B0_PIN_D2 G2
#define HM01B0_PIN_D3 G3
#define HM01B0_PIN_D4 G4
#define HM01B0_PIN_D5 G5
#define HM01B0_PIN_D6 G6
#define HM01B0_PIN_D7 G7
#define HM01B0_PIN_VSYNC CAM_VSYNC
#define HM01B0_PIN_HSYNC CAM_HSYNC
#define HM01B0_PIN_PCLK CAM_PCLK
#define HM01B0_PIN_SCL 14
#define HM01B0_PIN_SDA 12
#define HM01B0_PIN_TRIG D1
#define HM01B0_PIN_INT I2C_INT
// MCLK generation
#define HM01B0_MCLK_GENERATOR_MOD 1
#define HM01B0_MCLK_GENERATOR_SEG AM_HAL_CTIMER_TIMERA
#define HM01B0_PIN_MCLK CAM_MCLK
// I2C configuration
#define HM01B0_IOM_MODE AM_HAL_IOM_I2C_MODE
#define HM01B0_IOM_MODULE 4
#define HM01B0_I2C_CLOCK_FREQ 100000
#endif
Despite these adjustments, when uploading the code, I receive the following error:
Camera.begin() failed with code: 1
Is there a working example available for this specific hardware configuration, or alternatively, for the nRF52840 processor?
Does the nrf52840 throw the same error code?
The nRF52840 is encountering a pin configuration error when attempting to initialize the hardware
In file included from /home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:25:
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:67:41: error: 'AM_BSP_CAMERA_HM01B0_I2C_IOM' undeclared here (not in a function); did you mean 'AM_BSP_PRIM_I2C_IOM'?
#define HM01B0_IOM_MODULE AM_BSP_CAMERA_HM01B0_I2C_IOM
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:46:33: note: in expansion of macro 'HM01B0_IOM_MODULE'
.ui32IOMModule = HM01B0_IOM_MODULE,
^~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:48:41: error: 'AM_BSP_CAMERA_HM01B0_I2C_SCL_PIN' undeclared here (not in a function); did you mean 'AM_BSP_PRIM_I2C_SCL_PIN'?
#define HM01B0_PIN_SCL AM_BSP_CAMERA_HM01B0_I2C_SCL_PIN
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:52:33: note: in expansion of macro 'HM01B0_PIN_SCL'
.ui8PinSCL = HM01B0_PIN_SCL,
^~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:49:41: error: 'AM_BSP_CAMERA_HM01B0_I2C_SDA_PIN' undeclared here (not in a function); did you mean 'AM_BSP_PRIM_I2C_SDA_PIN'?
#define HM01B0_PIN_SDA AM_BSP_CAMERA_HM01B0_I2C_SDA_PIN
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:53:33: note: in expansion of macro 'HM01B0_PIN_SDA'
.ui8PinSDA = HM01B0_PIN_SDA,
^~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:61:41: error: 'AM_BSP_CAMERA_HM01B0_MCLK_GEN_MOD' undeclared here (not in a function)
#define HM01B0_MCLK_GENERATOR_MOD AM_BSP_CAMERA_HM01B0_MCLK_GEN_MOD
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:61:41: note: in definition of macro 'HM01B0_MCLK_GENERATOR_MOD'
#define HM01B0_MCLK_GENERATOR_MOD AM_BSP_CAMERA_HM01B0_MCLK_GEN_MOD
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:62:41: error: 'AM_BSP_CAMERA_HM01B0_MCLK_GEN_SEG' undeclared here (not in a function)
#define HM01B0_MCLK_GENERATOR_SEG AM_BSP_CAMERA_HM01B0_MCLK_GEN_SEG
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:62:41: note: in definition of macro 'HM01B0_MCLK_GENERATOR_SEG'
#define HM01B0_MCLK_GENERATOR_SEG AM_BSP_CAMERA_HM01B0_MCLK_GEN_SEG
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:63:41: error: 'AM_BSP_CAMERA_HM01B0_MCLK_PIN' undeclared here (not in a function); did you mean 'AM_BSP_PRIM_SPI_CLK_PIN'?
#define HM01B0_PIN_MCLK AM_BSP_CAMERA_HM01B0_MCLK_PIN
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:58:33: note: in expansion of macro 'HM01B0_PIN_MCLK'
.ui32CTimerOutputPin = HM01B0_PIN_MCLK,
^~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:37:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D0' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D0 AM_BSP_GPIO_CAMERA_HM01B0_D0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:61:33: note: in expansion of macro 'HM01B0_PIN_D0'
.ui8PinD0 = HM01B0_PIN_D0,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:38:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D1' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D1 AM_BSP_GPIO_CAMERA_HM01B0_D1
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:62:33: note: in expansion of macro 'HM01B0_PIN_D1'
.ui8PinD1 = HM01B0_PIN_D1,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:39:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D2' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D2 AM_BSP_GPIO_CAMERA_HM01B0_D2
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:63:33: note: in expansion of macro 'HM01B0_PIN_D2'
.ui8PinD2 = HM01B0_PIN_D2,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:40:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D3' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D3 AM_BSP_GPIO_CAMERA_HM01B0_D3
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:64:33: note: in expansion of macro 'HM01B0_PIN_D3'
.ui8PinD3 = HM01B0_PIN_D3,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:41:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D4' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D4 AM_BSP_GPIO_CAMERA_HM01B0_D4
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:65:33: note: in expansion of macro 'HM01B0_PIN_D4'
.ui8PinD4 = HM01B0_PIN_D4,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:42:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D5' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D5 AM_BSP_GPIO_CAMERA_HM01B0_D5
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:66:33: note: in expansion of macro 'HM01B0_PIN_D5'
.ui8PinD5 = HM01B0_PIN_D5,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:43:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D6' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D6 AM_BSP_GPIO_CAMERA_HM01B0_D6
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:67:33: note: in expansion of macro 'HM01B0_PIN_D6'
.ui8PinD6 = HM01B0_PIN_D6,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:44:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_D7' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_D7 AM_BSP_GPIO_CAMERA_HM01B0_D7
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:68:33: note: in expansion of macro 'HM01B0_PIN_D7'
.ui8PinD7 = HM01B0_PIN_D7,
^~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:45:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_VSYNC' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_VSYNC AM_BSP_GPIO_CAMERA_HM01B0_VSYNC
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:69:33: note: in expansion of macro 'HM01B0_PIN_VSYNC'
.ui8PinVSYNC = HM01B0_PIN_VSYNC,
^~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:46:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_HSYNC' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_HSYNC'?
#define HM01B0_PIN_HSYNC AM_BSP_GPIO_CAMERA_HM01B0_HSYNC
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:70:33: note: in expansion of macro 'HM01B0_PIN_HSYNC'
.ui8PinHSYNC = HM01B0_PIN_HSYNC,
^~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/include/hm01b0_platform_apollo3.h:47:41: error: 'AM_BSP_GPIO_CAMERA_HM01B0_PCLK' undeclared here (not in a function); did you mean 'AM_BSP_GPIO_CAM_PCLK'?
#define HM01B0_PIN_PCLK AM_BSP_GPIO_CAMERA_HM01B0_PCLK
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zai/Arduino/libraries/SparkFun_HM01B0_Camera_ArduinoLibrary/src/platforms/apollo3/src/hm01b0_platform_apollo3.c:71:33: note: in expansion of macro 'HM01B0_PIN_PCLK'
.ui8PinPCLK = HM01B0_PIN_PCLK,
^~~~~~~~~~~~~~~
exit status 1
Compilation error: exit status 1
I previously ran the Blink example to verify that both my board and processor are functioning correctly, and it was successful. The issue lies with the camera. Is there another example available, or perhaps a different camera that is compatible with either of my two configurations?
Artemis + Machine Learning MicroMod
nRF52840 + Machine Learning MicroMod