you will need to add the aux ports to the firmware and find a way to break out one of the pins that isn’t connected on the shield. Is your M2 board the one with the side connections for the motors? There is a Z+ and Z- plug port on them, but I thought it was connected to a pin that was in use. I’d start there, but you can get a shield spacer board that will fit between your due and the shield that will allow you to get access to all the other pins.
thank you for pointing me into the right direction. i was so fixed on the shield. of course all the free arduino gpio pins should be usable modifying the firmware.