add patch from Cirilo Bernardo, and minor fixes.
add patch from Cirilo Bernardo (about IDF export) , and minor fixes.