SPI problem

Dear All,
Last year I bought two beaglebone black and I used them in my project, I wrote my program in python language in cloud 9. I used spi protocol for communication between BBB and DAC(Digital to analog converter).
recently I have bought 5 beaglebone and I copied the same code. At first, It did not recognize spi part, later I reflash with the latest version, After reflashing the beaglebone I found that now beaglebone recognize the SPI part but it is not working and whatever data I send as the input, it is showing zero for the output.
, I saw on the internet, there were several questions related to this problem and I could not find any answer for them.
Before reflashing, I tried with PUTTY as well. For the test that I did with Putty, it did not recognize the SPI part like Cloud9. The interesting part is that after reflashing, I checked the blink Led with putty, and It did not recognize the GPIO this time.
Thanks for devoting your time, please let me know if you have any idea.

Best regards,

before reflashing, I have sent this code. and I had that error,
After that, the output is just [0]
Thanks for your help.

this is the details of my beaglebone black