The drv.c file I provided is for the SNLESSHALL reference project. There were some defects in that file for running the SNLESSHALL project in torque control mode.
In the SNLESSHALL project, the goal is to start the motor using the Hall sensors but then transition into FOC. It isn't intended to use the Halls for the complete speed range.