BojanG72 / STM32-Ceedling-Base

Minimal setup required to develop firmware for STM32 using ceedling
MIT License
16 stars 1 forks source link

how to simulator arm(about register bitbanding,read only,handle,which layer should be test) #5

Closed amigomcu closed 1 year ago

amigomcu commented 1 year ago

problem with testing: 1. bitbanding, a hardward feature,will not happen druing unit testing on a computer.

2.some register is ready only,.(define that SYNCBUSY is defined as Read-only(vilatile const),

3.pheripheral is address ,pc not access Memory registers, the memory register for the watchdog is given the addresss it has on the bus on the microcontroller.to be able to run test,it is necessary to give it a valid address on the computer that is executed on.

4. HWardware specific functionality, all watchdog functionality cannot be tested,since it depends on hardware.

Timer handle isp handle?

  1. Instructions,1. some api use 'instruction',that was not available in thx x86 instructions

  2. which layer is need test? (CMSIS,BSP,peripheral libray,device drivers

BojanG72 commented 1 year ago

Your correct that this setup does not include on target unit testing, and a lot of the hardware is not testable on the host machine.

I usually don't bother with on target unit testing, and usually only do unit testing for application code that can run on the host processor. The reason is because when I am developing driver level code I will usually do manual testing for the hardware to make sure its running correctly and the timings make sense. Then afterwards I would create system level tests, that test the overall functionality of the device. Both of these together with unit testing the application code should give you high confidence that everything is working as it should.

If you still feel like you need to do on target unit testing, that's possible, but would require changing the .yml file to compile and run on the target.