I've been setting up Ceedling for STM32. The howto is very scarce, so far I've managed to google next to nothing. Fortunately, the framework is relatively transparent for its size. This is a PIC configuration. I set up something similar (project.yml
):
...
:defines:
# in order to add common defines:
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:commmon: &common_defines #[]
- STM32F103xB
- UNITY_INT_WIDTH=32
- CMOCK_MEM_INDEX_TYPE=uint32_t
- UNITY_LINE_TYPE=uint16_t
:test:
- *common_defines
- TEST
:test_preprocess:
- *common_defines
- TEST
So far so good (no real work is yet attempted). Having added this definition
- CMOCK_MEM_PTR_AS_INT=uint32_t
I'm having a warning:
/vendor/ceedling/vendor/cmock/src/cmock.c:105:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE);
No wonder, as next
is a PC platform 64-bit pointer. Still I am not at all sure whether I have to control CMOCK_MEM_PTR_AS_INT
or not. It depends on whether CMOCK_MEM_PTR_AS_INT
is a critical target (ARM) platform definition.
So far I haven't found an STM32 example.