Hello Patricia
You can write tests against the actual hardware and that is a good idea when practical. I would not call it a unit test (unless you consider you are unit testing the hardware) I'd call it an integration test. You might want to look at this paper on how hardware in the loop fits in:
https://wingman-sw.com/articles/progress-before-hardware. I'd put hardware in the loop at what I call stage 4. A more refined version is in my book Test-Driven Development for Embedded C.
When hardware is in the loop, can you get the needed feedback from the hardware to know if the code is working? For example, if it is a flash device, you can read back what you write to memory as a test. Let's say it is a serial port, then you need a loopback connector. Let's say its an LED. You then need a way to look at it. Full instrumentation with a photo sensor is probably not worth it (but may be in your application). A partially automated test may be more suitable and at this point maybe a unit test harness is not what you want.
Using the actual hardware is not a substitute for automated unit testing with fakes and mocks.
Want to say more about your hardware?
Hope that helps, James
--------------------------------------------------------------------------