Hi thousandparadox,
I'm not sure if anyone has tested SMM on a cortex M4 but I will provide a few pointers..
-
Make sure of you hardware connections. The documentation describes the correct connections with regards to pull ups and pull downs.
-
In the packet that you are constructing you are assigning 40001 as the starting register but you are already implicitly requesting from address space 4xxxx by using function READ_HOLDING_REGISTERS. Try 0 or 1 depending on the offset.