with the command #spanning-tree vlan 400 everything works without that command #show spanning-tree shows the ports as forwarding even though I can't ping between the laptops. I'm guessing that this output refers to vlan 1 and the ports are in vlan 400 although why changing the uplink to a trunk would do this baffles me.  To be honest I know what to look out for, check the logs and check spanning-tree.    
I have a number of n2048p and am having the same issue so it's clearly something I'm doing/not doing. I have 2 laptop's connected to a switch and running constant pings between them. I create the vlan, give the vlan int an IP address and add the switch ports to the access vlan. I can now also ping the vlan interface from both laptops.  So far so good. I now set the uplinks as trunk interfaces and everything stops working. The laptops can't ping each other or the vlan int. Reset the uplinks back to access ports and it all works again. 
Cannot ping interfaces after configuring uplinks as trunks.