Back to regular toolchain, something goes wrong with the original one
Revert "Back to regular toolchain, something goes wrong with the original one"

This reverts commit 61676d94969eb119cb504b5401b8f7bc2755926d.
Add check for device type