Are you using the latest Yocto image? Previous images didn't have serial 2 properly set up on the Arduino environment, but it should work fine on the latest image. However you won't be able to see the output of serial 2 on the Arduino console since serial 2 pins are physically separated from it.
Hi Peter, sorry for replying so late. I've been too busy with another problems so I couldn't test other images, but I made it this morning.
At first, I was using this image that I got from here : IoT Download - Board Boot Image
I thought the image that I had been using was an older version, so I download it again and retry, which ended up with the same result.
I tried another image from Intel® Galileo Boards and Kits — Software Downloads (SD-Card Linux Image)
and it works properly now. thank you!
Hi CMata, thank you for your reply. I had been using Yocto 1.6 image, which I got from : IoT Download - Board Boot Image but it failed to write on the Serial2. With another image, Intel® Galileo Boards and Kits — Software Downloads, thankfully however, it works